Skip to content

Commit 395218d

Browse files
toymilalgesten
authored andcommitted
feat: add a feature flag "proxy-from-env" to control whether or not to detect proxy settings from environment by default
1 parent 260213b commit 395218d

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ socks-proxy = ["dep:socks"]
2626
gzip = ["dep:flate2"]
2727
brotli = ["dep:brotli-decompressor"]
2828
http-interop = ["dep:http"]
29+
proxy-from-env = []
2930

3031
[dependencies]
3132
base64 = "0.21"

src/agent.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ impl AgentBuilder {
264264
user_agent: format!("ureq/{}", env!("CARGO_PKG_VERSION")),
265265
tls_config: TlsConfig(crate::default_tls_config()),
266266
},
267+
#[cfg(feature = "proxy-from-env")]
268+
try_proxy_from_env: true,
269+
#[cfg(not(feature = "proxy-from-env"))]
267270
try_proxy_from_env: false,
268271
max_idle_connections: DEFAULT_MAX_IDLE_CONNECTIONS,
269272
max_idle_connections_per_host: DEFAULT_MAX_IDLE_CONNECTIONS_PER_HOST,

0 commit comments

Comments
 (0)