Update default_port and sni logic to improve reverse proxy reachability (#947)

This commit is contained in:
Zisu Zhang
2025-06-07 08:19:31 +08:00
committed by GitHub
parent a6773aa549
commit d34a51739f
2 changed files with 14 additions and 2 deletions
+9
View File
@@ -77,6 +77,15 @@ pub async fn socket_addrs(
.port()
.or_else(default_port_number)
.ok_or(Error::InvalidUrl(url.to_string()))?;
// See https://github.com/EasyTier/EasyTier/pull/947
let port = match port {
0 => match url.scheme() {
"ws" => 80,
"wss" => 443,
_ => port,
},
_ => port,
};
// if host is an ip address, return it directly
if let Ok(ip) = host.parse::<std::net::IpAddr>() {