Skip to content

Commit 4bd740b

Browse files
committed
fix(http): Add proxy transport
1 parent 2dff6c9 commit 4bd740b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

cli.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,13 @@ func New(opts map[string]interface{}) *Cli {
5757
}
5858
} else {
5959
transport := &http.Transport{
60+
Proxy: http.ProxyFromEnvironment,
6061
TLSClientConfig: &tls.Config{},
6162
}
6263
if insecureSkipVerify, ok := opts["insecure"].(bool); ok {
6364
transport.TLSClientConfig.InsecureSkipVerify = insecureSkipVerify
6465
}
6566

66-
if os.Getenv("HTTP_PROXY") != "" {
67-
proxyURL, _ := url.Parse(os.Getenv("HTTP_PROXY"))
68-
transport.Proxy = http.ProxyURL(proxyURL)
69-
}
70-
7167
ua = &http.Client{
7268
Jar: cookieJar,
7369
Transport: transport,

0 commit comments

Comments
 (0)