cmd/pprof: use proxy from environment

See #18736

Change-Id: I9c16357c05c16db677125d3077ee466b71559c7a
Reviewed-on: https://go-review.googlesource.com/38343
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Michel Lespinasse 2017-03-18 19:02:20 -07:00 committed by Brad Fitzpatrick
parent a68e5d94fa
commit 81bcc47041

View file

@ -22,6 +22,7 @@ import (
"time" "time"
"cmd/internal/objfile" "cmd/internal/objfile"
"github.com/google/pprof/driver" "github.com/google/pprof/driver"
"github.com/google/pprof/profile" "github.com/google/pprof/profile"
) )
@ -72,7 +73,8 @@ func getProfile(source string, timeout time.Duration) (*profile.Profile, error)
client := &http.Client{ client := &http.Client{
Transport: &http.Transport{ Transport: &http.Transport{
ResponseHeaderTimeout: timeout + 5*time.Second, ResponseHeaderTimeout: timeout + 5*time.Second,
TLSClientConfig: tlsConfig, Proxy: http.ProxyFromEnvironment,
TLSClientConfig: tlsConfig,
}, },
} }
resp, err := client.Get(source) resp, err := client.Get(source)