Skip to content

Commit

Permalink
feat: add a feature flag "proxy-from-env" to control whether or not t…
Browse files Browse the repository at this point in the history
…o detect proxy settings from environment by default
  • Loading branch information
toymil authored and algesten committed Nov 22, 2023
1 parent 260213b commit 395218d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ socks-proxy = ["dep:socks"]
gzip = ["dep:flate2"]
brotli = ["dep:brotli-decompressor"]
http-interop = ["dep:http"]
proxy-from-env = []

[dependencies]
base64 = "0.21"
Expand Down
3 changes: 3 additions & 0 deletions src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ impl AgentBuilder {
user_agent: format!("ureq/{}", env!("CARGO_PKG_VERSION")),
tls_config: TlsConfig(crate::default_tls_config()),
},
#[cfg(feature = "proxy-from-env")]
try_proxy_from_env: true,
#[cfg(not(feature = "proxy-from-env"))]
try_proxy_from_env: false,
max_idle_connections: DEFAULT_MAX_IDLE_CONNECTIONS,
max_idle_connections_per_host: DEFAULT_MAX_IDLE_CONNECTIONS_PER_HOST,
Expand Down

0 comments on commit 395218d

Please sign in to comment.