From 81bcc470416e97a63570536fd6f1f191347a9adb Mon Sep 17 00:00:00 2001 From: Michel Lespinasse Date: Sat, 18 Mar 2017 19:02:20 -0700 Subject: [PATCH] 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 --- src/cmd/pprof/pprof.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmd/pprof/pprof.go b/src/cmd/pprof/pprof.go index 5a6e1c14235..24bec07d975 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)