pub struct SystemProxyResolver { /* private fields */ }
Expand description

The system proxy resolver.

Resolve proxies from system configuration, and through operating system APIs.

Implementations

Create a new system proxy resolver.

Creates an instance of the standard proxy resolver for the current operating system and uses the given environment proxy settings.

Create a system proxy resolver which never looks at the environment.

This resolver will only use the standard proxy resolver of the operating system.

Resolve system proxy to use for url.

Return the proxy URL to use or None for a direct connection.

Environment

On all systems this resolver first looks at the proxy settings in the environment, per env::EnvProxies and env::EnvNoProxy.

The proxies specified in the environment take precedence over the system proxy, and the system proxy is not consulted for URLs that match the env::EnvNoProxy settings. This allows to quickly disable all proxying for a given application by setting $no_proxy to *, even if the appliation looks up a system proxy.

Operating system proxy resolver
Linux and other unix systems

On Linux and other Unix systems this function checks Gnome’s proxy configuration through the Gio API, if the corresponding gio feature is enabled (default). This enables support for more advanced proxy configuration schemes, in particular PAC URLs for proxy configuration.

MacOS

MacOS is not supported currently. Pull requests welcome.

Windows

On Windows this function uses the WinHTTP API to resolve the Windows system proxy configuration. However it disables automatic resolution of PAC URLs through DHCP or DNS queries in the local network; this can take several seconds and shouldn’t be done synchronously. If you require support for this kind of setup please refer to the async API.

Trait Implementations

Create the default system proxy resolver.

This proxy resolver uses the curl environment by default (see env::EnvProxies::from_curl_env() and env::EnvNoProxy::from_curl_env()) by default and falls back to the standard proxy resolver of the operating system.

See SystemProxyResolver::for_url for more information about how the proxy is resolved.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.