From 39c3daee2317b41c49e6be94997fa9420d3ae9d0 Mon Sep 17 00:00:00 2001 From: skymeyer Date: Sat, 19 Jan 2019 10:46:08 +0000 Subject: [PATCH] Honor system http proxies when using non-default transport This implements the same proxy behavior as per http.DefaultTransport using HTTP proxies as directed by the $HTTP_PROXY and $NO_PROXY (or $http_proxy and $no_proxy) environment variables. --- gerrit/widget.go | 1 + jenkins/client.go | 1 + jira/client.go | 1 + 3 files changed, 3 insertions(+) diff --git a/gerrit/widget.go b/gerrit/widget.go index 0819378e..051c7f02 100644 --- a/gerrit/widget.go +++ b/gerrit/widget.go @@ -79,6 +79,7 @@ func (widget *Widget) Refresh() { TLSClientConfig: &tls.Config{ InsecureSkipVerify: !verifyServerCertificate, }, + Proxy: http.ProxyFromEnvironment, }, } diff --git a/jenkins/client.go b/jenkins/client.go index 080f781d..97105c86 100644 --- a/jenkins/client.go +++ b/jenkins/client.go @@ -34,6 +34,7 @@ func Create(jenkinsURL string, username string, apiKey string) (*View, error) { TLSClientConfig: &tls.Config{ InsecureSkipVerify: !verifyServerCertificate, }, + Proxy: http.ProxyFromEnvironment, }, } resp, err := httpClient.Do(req) diff --git a/jira/client.go b/jira/client.go index fe74d731..df639251 100644 --- a/jira/client.go +++ b/jira/client.go @@ -75,6 +75,7 @@ func jiraRequest(path string) (*http.Response, error) { TLSClientConfig: &tls.Config{ InsecureSkipVerify: !verifyServerCertificate, }, + Proxy: http.ProxyFromEnvironment, }, } resp, err := httpClient.Do(req)