fix(http): Add proxy transport

This commit is contained in:
William Hearn
2016-12-17 16:50:34 -05:00
parent 72c78c6c1c
commit b326623ed2
+1 -5
View File
@@ -57,17 +57,13 @@ func New(opts map[string]interface{}) *Cli {
}
} else {
transport := &http.Transport{
Proxy: http.ProxyFromEnvironment,
TLSClientConfig: &tls.Config{},
}
if insecureSkipVerify, ok := opts["insecure"].(bool); ok {
transport.TLSClientConfig.InsecureSkipVerify = insecureSkipVerify
}
if os.Getenv("HTTP_PROXY") != "" {
proxyURL, _ := url.Parse(os.Getenv("HTTP_PROXY"))
transport.Proxy = http.ProxyURL(proxyURL)
}
ua = &http.Client{
Jar: cookieJar,
Transport: transport,