From 7542f63e5c96842953ff936523ca3aa8c610aada Mon Sep 17 00:00:00 2001 From: 0x676e67 Date: Tue, 19 May 2026 11:06:55 +0800 Subject: [PATCH] feat(proxy): follow system proxy settings --- Cargo.lock | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 1 + 2 files changed, 69 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 62bf43e..86b30a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -224,6 +224,22 @@ dependencies = [ "version_check", ] +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + [[package]] name = "crc32fast" version = "1.5.0" @@ -1112,6 +1128,27 @@ dependencies = [ "syn", ] +[[package]] +name = "system-configuration" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" +dependencies = [ + "bitflags", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tap" version = "1.0.1" @@ -1406,6 +1443,35 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[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", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-sys" version = "0.61.2" @@ -1453,6 +1519,7 @@ dependencies = [ "smallvec", "socket2", "sync_wrapper", + "system-configuration", "tokio", "tokio-boring2", "tokio-socks", @@ -1462,6 +1529,7 @@ dependencies = [ "url", "want", "webpki-root-certs", + "windows-registry", "zstd", ] diff --git a/Cargo.toml b/Cargo.toml index 7a41933..28d3b61 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,7 @@ wreq = { version = "6.0.0-rc.28", features = [ "brotli", "deflate", "zstd", + "system-proxy", ] } wreq-util = "3.0.0-rc.11" serde = { version = "1.0.228", features = ["derive"] }