From 6c04e86a8c3c66e54ec6c2bbda38b1b1aef39cd4 Mon Sep 17 00:00:00 2001 From: ston1th Date: Sat, 16 Oct 2021 17:55:46 +0200 Subject: [PATCH] added more default client options --- client.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index ed9c4d4..f941bc3 100644 --- a/client.go +++ b/client.go @@ -198,8 +198,14 @@ func NewClient(options ...ClientOption) *Client { if client.httpClient == nil { client.httpClient = &http.Client{Transport: &http.Transport{ DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, }).DialContext, + ForceAttemptHTTP2: true, + MaxIdleConns: 100, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, TLSClientConfig: &tls.Config{ InsecureSkipVerify: client.insecure, },