From 578507ae77798bdc5f20b7982624e84be68f7880 Mon Sep 17 00:00:00 2001 From: bergquist Date: Tue, 1 Nov 2016 08:58:44 +0100 Subject: [PATCH] tech(cli): add default settings for transport --- pkg/cmd/grafana-cli/services/services.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/grafana-cli/services/services.go b/pkg/cmd/grafana-cli/services/services.go index 8f901046edb..6c739f8b0ee 100644 --- a/pkg/cmd/grafana-cli/services/services.go +++ b/pkg/cmd/grafana-cli/services/services.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "io/ioutil" + "net" "net/http" "net/url" "path" @@ -25,7 +26,16 @@ func Init(version string) { grafanaVersion = version tr := &http.Transport{ - Proxy: http.ProxyFromEnvironment, + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + }).DialContext, + MaxIdleConns: 100, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + TLSClientConfig: &tls.Config{InsecureSkipVerify: false}, }