Browse Source

Enable socks feature for reqwest

This allowed HTTP_PROXY be set with a socks5 proxy
Jake Howard 4 years ago
parent
commit
f7056bcaa5
2 changed files with 40 additions and 1 deletions
  1. 39 0
      Cargo.lock
  2. 1 1
      Cargo.toml

+ 39 - 0
Cargo.lock

@@ -563,6 +563,12 @@ version = "0.15.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
 checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
 
 
+[[package]]
+name = "either"
+version = "1.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
+
 [[package]]
 [[package]]
 name = "encoding_rs"
 name = "encoding_rs"
 version = "0.8.28"
 version = "0.8.28"
@@ -2213,6 +2219,7 @@ dependencies = [
  "serde_urlencoded",
  "serde_urlencoded",
  "tokio",
  "tokio",
  "tokio-native-tls",
  "tokio-native-tls",
+ "tokio-socks",
  "tokio-util",
  "tokio-util",
  "url 2.2.1",
  "url 2.2.1",
  "wasm-bindgen",
  "wasm-bindgen",
@@ -2767,6 +2774,26 @@ dependencies = [
  "utf-8",
  "utf-8",
 ]
 ]
 
 
+[[package]]
+name = "thiserror"
+version = "1.0.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e"
+dependencies = [
+ "thiserror-impl",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "1.0.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0"
+dependencies = [
+ "proc-macro2 1.0.24",
+ "quote 1.0.9",
+ "syn 1.0.65",
+]
+
 [[package]]
 [[package]]
 name = "threadpool"
 name = "threadpool"
 version = "1.8.1"
 version = "1.8.1"
@@ -2865,6 +2892,18 @@ dependencies = [
  "tokio",
  "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]]
 [[package]]
 name = "tokio-util"
 name = "tokio-util"
 version = "0.6.5"
 version = "0.6.5"

+ 1 - 1
Cargo.toml

@@ -32,7 +32,7 @@ rocket = { version = "0.5.0-dev", features = ["tls"], default-features = false }
 rocket_contrib = "0.5.0-dev"
 rocket_contrib = "0.5.0-dev"
 
 
 # HTTP client
 # HTTP client
-reqwest = { version = "0.11.2", features = ["blocking", "json", "gzip", "brotli"] }
+reqwest = { version = "0.11.2", features = ["blocking", "json", "gzip", "brotli", "socks"] }
 
 
 # multipart/form-data support
 # multipart/form-data support
 multipart = { version = "0.17.1", features = ["server"], default-features = false }
 multipart = { version = "0.17.1", features = ["server"], default-features = false }