From 4c81e4a6938cd639ee24346d3d315845902434a2 Mon Sep 17 00:00:00 2001 From: Sheldon Date: Fri, 31 Dec 2021 05:19:34 -0500 Subject: [PATCH] Fix socks5 proxy support (#629) --- impls/src/adapters/http.rs | 2 +- impls/src/client_utils/client.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/impls/src/adapters/http.rs b/impls/src/adapters/http.rs index 7d9f360d7..46cc39971 100644 --- a/impls/src/adapters/http.rs +++ b/impls/src/adapters/http.rs @@ -164,7 +164,7 @@ impl HttpSlateSender { IN: Serialize, { let client = - if self.use_socks { + if !self.use_socks { Client::new() } else { Client::with_socks_proxy(self.socks_proxy_addr.ok_or_else(|| { diff --git a/impls/src/client_utils/client.rs b/impls/src/client_utils/client.rs index bc4cb1246..a0f42dec6 100644 --- a/impls/src/client_utils/client.rs +++ b/impls/src/client_utils/client.rs @@ -125,7 +125,7 @@ impl Client { .default_headers(headers); if let Some(s) = socks_proxy_addr { - let proxy = Proxy::all(&format!("socks5://{}:{}", s.ip(), s.port())) + let proxy = Proxy::all(&format!("socks5h://{}:{}", s.ip(), s.port())) .map_err(|e| ErrorKind::Internal(format!("Unable to create proxy: {}", e)))?; builder = builder.proxy(proxy); }