From f25a53db7d2b3f25bf6e04b7a90006fbd32d04b8 Mon Sep 17 00:00:00 2001 From: Ao Chen Date: Thu, 4 Apr 2024 12:13:40 +0800 Subject: [PATCH] Add socks5 proxy support --- Cargo.lock | 19 +++++++++++++++++++ Cargo.toml | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index da743c95..bff4bf00 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -427,6 +427,12 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +[[package]] +name = "either" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" + [[package]] name = "encode_unicode" version = "0.3.6" @@ -1389,6 +1395,7 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-rustls", + "tokio-socks", "tower-service", "url", "wasm-bindgen", @@ -1945,6 +1952,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-socks" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51165dfa029d2a65969413a6cc96f354b86b464498702f174a4efa13608fd8c0" +dependencies = [ + "either", + "futures-util", + "thiserror", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.10" diff --git a/Cargo.toml b/Cargo.toml index 3842f3a6..b99faa7e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ guess_host_triple = "0.1.3" log = "0.4.20" miette = { version = "5.10.0", features = ["fancy"] } regex = "1.10.3" -reqwest = { version = "0.11.24", features = ["blocking"] } +reqwest = { version = "0.11.24", features = ["blocking", "socks"] } retry = "2.0.0" serde_json = "1.0.113" strum = { version = "0.26.1", features = ["derive"] }