added more default client options

This commit is contained in:
ston1th 2021-10-16 18:00:33 +02:00
commit fbf7fed2ce

View file

@ -91,7 +91,13 @@ func NewAllocator(opts ...Option) (netalloc.Allocator, error) {
a.httpClient = &http.Client{Transport: &http.Transport{ a.httpClient = &http.Client{Transport: &http.Transport{
DialContext: (&net.Dialer{ DialContext: (&net.Dialer{
Timeout: 30 * time.Second, Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).DialContext, }).DialContext,
ForceAttemptHTTP2: true,
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
TLSClientConfig: &tls.Config{ TLSClientConfig: &tls.Config{
InsecureSkipVerify: a.insecure, InsecureSkipVerify: a.insecure,
}, },