diff --git a/Cargo.lock b/Cargo.lock index 23ff2ad8..96b6bd03 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -314,6 +314,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -724,7 +734,7 @@ dependencies = [ "rand 0.10.2", "resolv-conf", "smallvec", - "system-configuration", + "system-configuration 0.7.0", "thiserror 2.0.20", "tokio", "tracing", @@ -922,8 +932,8 @@ checksum = "4d40460c0ce33d6ce4b0630ad68ff63d6661961c48b6dba35e5a4d81cfb48222" dependencies = [ "socket2", "widestring", - "windows-registry", - "windows-result", + "windows-registry 0.6.1", + "windows-result 0.4.1", "windows-sys 0.61.2", ] @@ -956,7 +966,7 @@ dependencies = [ "simd_cesu8", "thiserror 2.0.20", "walkdir", - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -1025,7 +1035,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" dependencies = [ "cfg-if", - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -1260,7 +1270,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -1797,7 +1807,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" dependencies = [ "bitflags", - "core-foundation", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501336eb7ba9e417300a6a0fa985721065467aa83a6dcf0422a8e43e4c0328fa" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", "system-configuration-sys", ] @@ -2311,15 +2332,32 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-link" +version = "0.100.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b39de7c7fe78858b0144c50c3fc000bab3be17d5e9b85b1053871693c7f7415" + [[package]] name = "windows-registry" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" dependencies = [ - "windows-link", - "windows-result", - "windows-strings", + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", +] + +[[package]] +name = "windows-registry" +version = "0.100.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a14b75dbbc0f2bb1ebbf6dcb6dc0035ae17f10ec280045d10fa27ad8874903b2" +dependencies = [ + "windows-link 0.100.0", + "windows-result 0.100.0", + "windows-strings 0.100.0", ] [[package]] @@ -2328,7 +2366,16 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "windows-link", + "windows-link 0.2.1", +] + +[[package]] +name = "windows-result" +version = "0.100.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44873a1ef61c85d5e2991db91fe656cfcf0731097e00dff1ac860f1cb3b752a0" +dependencies = [ + "windows-link 0.100.0", ] [[package]] @@ -2337,7 +2384,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ - "windows-link", + "windows-link 0.2.1", +] + +[[package]] +name = "windows-strings" +version = "0.100.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a70b590c684f1d2854f74999896f7c0558f1bdde62f599088599e20ea1d2f60" +dependencies = [ + "windows-link 0.100.0", ] [[package]] @@ -2355,7 +2411,7 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-link", + "windows-link 0.2.1", ] [[package]] @@ -2459,6 +2515,7 @@ dependencies = [ "serde_json", "socket2", "sync_wrapper", + "system-configuration 0.8.0", "tokio", "tokio-btls", "tokio-socks", @@ -2468,6 +2525,7 @@ dependencies = [ "tower-http", "url", "webpki-root-certs", + "windows-registry 0.100.0", "wreq-rt", ] diff --git a/Cargo.toml b/Cargo.toml index 420648e3..10f0902b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,6 +54,7 @@ wreq = { version = "0.16.1", default-features = false, features = [ "form", "json", "socks", + "system-proxy", "stream", "multipart", "cookies", diff --git a/docs/source/guide/proxy.md b/docs/source/guide/proxy.md index d9de68fe..a2b597b5 100644 --- a/docs/source/guide/proxy.md +++ b/docs/source/guide/proxy.md @@ -36,6 +36,11 @@ async def main(): asyncio.run(main()) ``` +By default, a client without `proxies` uses the system proxy: the +`HTTP_PROXY`, `HTTPS_PROXY`, `ALL_PROXY` and `NO_PROXY` environment variables +(and their lowercase forms), plus the operating system proxy settings on macOS +and Windows. + For direct connections that ignore environment and system proxy settings, use `Client(no_proxy=True)`. This also clears proxies configured on that client. To exclude hosts from a particular proxy, pass an exclusion list when creating