Skip to content

Commit

Permalink
Add proxy support
Browse files Browse the repository at this point in the history
  • Loading branch information
moorereason authored and davecheney committed Sep 28, 2016
1 parent 2bb6516 commit 004e1ba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,14 @@ func visit(url *url.URL) {

req = req.WithContext(httptrace.WithClientTrace(context.Background(), trace))

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

tr := &http.Transport{
Proxy: http.ProxyURL(proxyURL),
}
if scheme == "https" {
tr.TLSClientConfig = &tls.Config{
ServerName: host,
Expand Down

0 comments on commit 004e1ba

Please sign in to comment.