From 5fc87d64551afe386b337d20e6e5c26235c3a5b6 Mon Sep 17 00:00:00 2001 From: Aykhan Shahsuvarov Date: Thu, 29 Aug 2024 19:12:40 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20proxy=20client=20address?= =?UTF-8?q?=20extra=20port=20443?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requests/requests.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/requests/requests.go b/requests/requests.go index 6711fb5..9fe3a62 100644 --- a/requests/requests.go +++ b/requests/requests.go @@ -405,12 +405,17 @@ func findActiveProxyClients( return } + isTLS := URL.Scheme == "https" + addr := URL.Host + if isTLS && URL.Port() == "" { + addr += ":443" + } if response.StatusCode() == 200 { *activeProxyClients = append( *activeProxyClients, fasthttp.HostClient{ - IsTLS: URL.Scheme == "https", - Addr: URL.Host + ":443", + IsTLS: isTLS, + Addr: addr, Dial: dialFunc, MaxIdleConnDuration: timeout, MaxConnDuration: timeout,