From 3e6fa2036ee2762c6792dd6ab16dc2d39a278d40 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Tue, 24 Oct 2023 16:56:01 +0100 Subject: [PATCH] Remove idle connections setup and allow the client to handle them --- proxy.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/proxy.go b/proxy.go index edf227d..6cad9ee 100644 --- a/proxy.go +++ b/proxy.go @@ -18,13 +18,7 @@ func createFasthttpClient(timeout int) *fasthttp.Client { TLSConfig: &tls.Config{ InsecureSkipVerify: true, }, - MaxConnsPerHost: 100, - MaxIdleConnDuration: func() time.Duration { - if timeout%2 != 0 { - timeout++ - } - return time.Duration(timeout/2) * time.Second - }(), + MaxConnsPerHost: 200, ReadTimeout: time.Second * time.Duration(timeout), WriteTimeout: time.Second * time.Duration(timeout), DisableHeaderNamesNormalizing: true,