From: Michel Lespinasse Date: Sun, 19 Mar 2017 02:02:20 +0000 (-0700) Subject: cmd/pprof: use proxy from environment X-Git-Tag: go1.9beta1~1103 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=81bcc470416e97a63570536fd6f1f191347a9adb;p=gostls13.git cmd/pprof: use proxy from environment See #18736 Change-Id: I9c16357c05c16db677125d3077ee466b71559c7a Reviewed-on: https://go-review.googlesource.com/38343 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/pprof/pprof.go b/src/cmd/pprof/pprof.go index 5a6e1c1423..24bec07d97 100644 --- a/src/cmd/pprof/pprof.go +++ b/src/cmd/pprof/pprof.go @@ -22,6 +22,7 @@ import ( "time" "cmd/internal/objfile" + "github.com/google/pprof/driver" "github.com/google/pprof/profile" ) @@ -72,7 +73,8 @@ func getProfile(source string, timeout time.Duration) (*profile.Profile, error) client := &http.Client{ Transport: &http.Transport{ ResponseHeaderTimeout: timeout + 5*time.Second, - TLSClientConfig: tlsConfig, + Proxy: http.ProxyFromEnvironment, + TLSClientConfig: tlsConfig, }, } resp, err := client.Get(source)