Skip to content

Commit

Permalink
fix(http): Add proxy transport
Browse files Browse the repository at this point in the history
  • Loading branch information
sylus committed Dec 17, 2016
1 parent 2dff6c9 commit 4bd740b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4bd740b

Please sign in to comment.