mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 20:52:33 +02:00
23 lines
526 B
Go
23 lines
526 B
Go
package utils
|
|
|
|
import (
|
|
"crypto/tls"
|
|
"net"
|
|
"net/http"
|
|
|
|
"github.com/yusing/go-proxy/internal/common"
|
|
)
|
|
|
|
var httpClient = &http.Client{
|
|
Timeout: common.ConnectionTimeout,
|
|
Transport: &http.Transport{
|
|
Proxy: http.ProxyFromEnvironment,
|
|
DisableKeepAlives: true,
|
|
ForceAttemptHTTP2: true,
|
|
DialContext: (&net.Dialer{
|
|
Timeout: common.DialTimeout,
|
|
KeepAlive: common.KeepAlive, // this is different from DisableKeepAlives
|
|
}).DialContext,
|
|
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
|
},
|
|
}
|