Skip to content

Commit

Permalink
Match DefaultTransport implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
moorereason authored and davecheney committed Sep 29, 2016
1 parent 6e9f241 commit ed35c02
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,12 @@ func visit(url *url.URL) {
}
req = req.WithContext(httptrace.WithClientTrace(context.Background(), trace))

proxyURL, err := http.ProxyFromEnvironment(req)
if err != nil {
log.Fatalf("error retrieving proxy from environment: %v", err)
}

tr := &http.Transport{
Proxy: http.ProxyURL(proxyURL),
Proxy: http.ProxyFromEnvironment,
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
}

switch url.Scheme {
Expand Down

0 comments on commit ed35c02

Please sign in to comment.