Skip to main content

proxy_from_environment

Function proxy_from_environment 

Source
pub fn proxy_from_environment() -> ProxyFn
Expand description

A ProxyFn that reads the standard proxy environment variables, mirroring Go’s http.ProxyFromEnvironment:

  • HTTPS_PROXY / https_proxy for https:// requests,
  • HTTP_PROXY / http_proxy for http:// requests,
  • NO_PROXY / no_proxy a comma-separated exclusion list.

NO_PROXY entries match by exact host, by .suffix (any sub-domain), or * (everything). The environment is read on each call. A bare host:port proxy value is treated as an http:// URL.