Skip to main content

build_proxy_connector

Function build_proxy_connector 

Source
pub fn build_proxy_connector(
    config: &ProxyConfig,
) -> Result<ProxyAwareConnector, HttpStackError>
Expand description

Build a full connector from ProxyConfig.

  • Disabled → still returns a ProxyConnector, but with no entries; match_proxy always returns None, behaving equivalently to “no proxy”.
  • FromEnv → reads HTTP_PROXY / HTTPS_PROXY / NO_PROXY (case-insensitive, lowercase preferred, matching curl conventions).
  • Explicit → uses the given values directly.

§Errors

Returns an error if loading native TLS roots fails, or if a proxy URL from the environment cannot be parsed.