From 7c72bc3959cf4665d8688289eaa18b776b439fed Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 8 Sep 2021 18:20:27 +0300 Subject: [PATCH] Set 80 as default port for http --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 1e6bde2..a6770a5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -442,7 +442,7 @@ where if let (Some(p), Some(host)) = (self.match_proxy(&uri), uri.host()) { if uri.scheme() == Some(&http::uri::Scheme::HTTPS) || p.force_connect { let host = host.to_owned(); - let port = uri.port_u16().unwrap_or(443); + let port = uri.port_u16().unwrap_or(if uri.scheme() == Some(&http::uri::Scheme::HTTP) { 80 } else { 443 }); let tunnel = tunnel::new(&host, port, &p.headers); let connection = proxy_dst(&uri, &p.uri).map(|proxy_url| self.connector.call(proxy_url));