Fix socks5 proxy support (#629)

This commit is contained in:
Sheldon
2021-12-31 10:19:34 +00:00
committed by GitHub
parent 34d23eb17a
commit 4c81e4a693
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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(|| {
+1 -1
View File
@@ -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);
}