Proxy

Proxy Configuration Module

Proxy configuration from environment variables.

Quarto Wizard respects standard proxy environment variables for network requests. This is useful when working behind a corporate proxy.

Envvar

HTTP_PROXY - Proxy URL for HTTP requests.

Envvar

http_proxy - Proxy URL for HTTP requests (lowercase variant).

Envvar

HTTPS_PROXY - Proxy URL for HTTPS requests.

Envvar

https_proxy - Proxy URL for HTTPS requests (lowercase variant).

Envvar

NO_PROXY - Comma or space-separated list of hosts to bypass the proxy.

Envvar

no_proxy - Comma or space-separated list of hosts to bypass (lowercase variant).

The uppercase variants take precedence over lowercase if both are set.

Examples

Terminal
export HTTPS_PROXY=http://proxy.example.com:8080
Terminal
export HTTPS_PROXY=http://user:password@proxy.example.com:8080
Terminal
export NO_PROXY=localhost,127.0.0.1,.internal.corp

Pattern

    • Matches all hosts (disables proxy).

Pattern

example.com - Matches exactly example.com and subdomains like api.example.com.

Pattern

.example.com - Matches domain example.com and all subdomains.

Pattern

localhost - Matches the literal hostname localhost.

Pattern

127.0.0.1 - Matches the literal IP address.

Note

CIDR notation (e.g., 192.168.1.0/24) is not supported.

Interfaces

ProxyConfig

Defined in: packages/core/src/proxy/config.ts:46

Proxy configuration.

Properties
Property Type Description Defined in
httpProxy? string Proxy URL for HTTP requests. packages/core/src/proxy/config.ts:48
httpsProxy? string Proxy URL for HTTPS requests. packages/core/src/proxy/config.ts:50
noProxy string[] List of hosts/patterns to bypass the proxy. packages/core/src/proxy/config.ts:52

Functions

getProxyConfig()

TypeScript
function getProxyConfig(): ProxyConfig;

Defined in: packages/core/src/proxy/config.ts:88

Read proxy configuration from environment variables.

Returns

ProxyConfig

Proxy configuration

getProxyForUrl()

TypeScript
function getProxyForUrl(url, config?): string | undefined;

Defined in: packages/core/src/proxy/config.ts:146

Get the appropriate proxy URL for a given request URL.

Parameters
Parameter Type Description
url string Request URL
config? ProxyConfig Proxy configuration
Returns

string | undefined

Proxy URL or undefined if no proxy should be used

shouldBypassProxy()

TypeScript
function shouldBypassProxy(hostname, noProxy): boolean;

Defined in: packages/core/src/proxy/config.ts:109

Check if a hostname should bypass the proxy.

Supports patterns:

  • “*” matches all hosts
  • “.example.com” matches example.com and all subdomains
  • “example.com” matches exactly example.com
  • “192.168.1.0/24” style CIDR is NOT supported (matched literally)
Parameters
Parameter Type Description
hostname string Hostname to check
noProxy string[] List of NO_PROXY patterns
Returns

boolean

True if the host should bypass the proxy

Proxy-Aware Fetch Module

Proxy-aware fetch wrapper using undici.

Automatically routes requests through configured proxy servers.

Interfaces

ProxyFetchOptions

Defined in: packages/core/src/proxy/fetch.ts:72

Options for proxy-aware fetch.

Extends
  • RequestInit
Properties
Property Type Description Inherited from Defined in
body? BodyInit - RequestInit.body node_modules/undici-types/fetch.d.ts:123
cache? RequestCache - RequestInit.cache node_modules/undici-types/fetch.d.ts:124
credentials? RequestCredentials - RequestInit.credentials node_modules/undici-types/fetch.d.ts:125
dispatcher? Dispatcher - RequestInit.dispatcher node_modules/undici-types/fetch.d.ts:126
duplex? "half" - RequestInit.duplex node_modules/undici-types/fetch.d.ts:127
headers? HeadersInit - RequestInit.headers node_modules/undici-types/fetch.d.ts:128
integrity? string - RequestInit.integrity node_modules/undici-types/fetch.d.ts:129
keepalive? boolean - RequestInit.keepalive node_modules/undici-types/fetch.d.ts:130
method? string - RequestInit.method node_modules/undici-types/fetch.d.ts:131
mode? RequestMode - RequestInit.mode node_modules/undici-types/fetch.d.ts:132
proxyConfig? ProxyConfig Proxy configuration. If not provided, reads from environment. - packages/core/src/proxy/fetch.ts:74
redirect? RequestRedirect - RequestInit.redirect node_modules/undici-types/fetch.d.ts:133
referrer? string - RequestInit.referrer node_modules/undici-types/fetch.d.ts:134
referrerPolicy? ReferrerPolicy - RequestInit.referrerPolicy node_modules/undici-types/fetch.d.ts:135
signal? AbortSignal | null - RequestInit.signal node_modules/undici-types/fetch.d.ts:136
window? null - RequestInit.window node_modules/undici-types/fetch.d.ts:137

Functions

clearProxyAgentCache()

TypeScript
function clearProxyAgentCache(): void;

Defined in: packages/core/src/proxy/fetch.ts:137

Clear the proxy agent cache. Useful for testing or when proxy configuration changes.

Returns

void

proxyFetch()

TypeScript
function proxyFetch(url, options): Promise<Response>;

Defined in: packages/core/src/proxy/fetch.ts:109

Proxy-aware fetch function.

Uses undici’s fetch with ProxyAgent when a proxy is configured via environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY).

Parameters
Parameter Type Description
url string | URL URL to fetch
options ProxyFetchOptions Fetch options with optional proxy configuration
Returns

Promise<Response>

Response

Back to top