Revert "client: Fix an issue where non-IP proxy URLs didn’t resolve c… (#33013)
This reverts commit bc68455320
.
More bugs...
Closes #32838
Release Notes:
- N/A
This commit is contained in:
parent
2839c2e492
commit
dec7baeb97
5 changed files with 8 additions and 154 deletions
|
@ -1,7 +1,5 @@
|
|||
//! socks proxy
|
||||
|
||||
use std::net::SocketAddr;
|
||||
|
||||
use anyhow::{Context as _, Result};
|
||||
use http_client::Url;
|
||||
use tokio::net::TcpStream;
|
||||
|
@ -10,8 +8,6 @@ use tokio_socks::{
|
|||
tcp::{Socks4Stream, Socks5Stream},
|
||||
};
|
||||
|
||||
use crate::proxy::SYSTEM_DNS_RESOLVER;
|
||||
|
||||
use super::AsyncReadWrite;
|
||||
|
||||
/// Identification to a Socks V4 Proxy
|
||||
|
@ -77,14 +73,12 @@ pub(super) async fn connect_socks_proxy_stream(
|
|||
};
|
||||
let rpc_host = match (rpc_host, local_dns) {
|
||||
(TargetAddr::Domain(domain, port), true) => {
|
||||
let ip_addr = SYSTEM_DNS_RESOLVER
|
||||
.lookup_ip(domain.as_ref())
|
||||
let ip_addr = tokio::net::lookup_host((domain.as_ref(), port))
|
||||
.await
|
||||
.with_context(|| format!("Failed to lookup domain {}", domain))?
|
||||
.into_iter()
|
||||
.next()
|
||||
.ok_or_else(|| anyhow::anyhow!("Failed to lookup domain {}", domain))?;
|
||||
TargetAddr::Ip(SocketAddr::new(ip_addr, port))
|
||||
TargetAddr::Ip(ip_addr)
|
||||
}
|
||||
(rpc_host, _) => rpc_host,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue