update http

This commit is contained in:
影舞者
2022-01-07 17:45:13 +08:00
parent c3fc054912
commit 49a3b94c53
+3 -3
View File
@@ -34,13 +34,13 @@ func InitHttpClient(ThreadsNum int, DownProxy string, Timeout time.Duration) err
tr := &http.Transport{ tr := &http.Transport{
DialContext: dialer.DialContext, DialContext: dialer.DialContext,
MaxConnsPerHost: 0, MaxConnsPerHost: 5,
MaxIdleConns: 0, MaxIdleConns: 0,
MaxIdleConnsPerHost: ThreadsNum * 2, MaxIdleConnsPerHost: 2,
IdleConnTimeout: keepAlive, IdleConnTimeout: keepAlive,
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
TLSHandshakeTimeout: 5 * time.Second, TLSHandshakeTimeout: 5 * time.Second,
DisableKeepAlives: true, DisableKeepAlives: false,
} }
if DownProxy != "" { if DownProxy != "" {
if DownProxy == "1" { if DownProxy == "1" {