Skip to content
Snippets Groups Projects
Unverified Commit 46c13b51 authored by Lee Tang's avatar Lee Tang Committed by GitHub
Browse files

Restore the ability to use a proxy for all HTTP requests

The default transport was changed in commit 0d66f2c6 and the proxy feature was forgotten.

- https://golang.org/src/net/http/transport.go#L43
- https://golang.org/pkg/net/http/#ProxyFromEnvironment
parent d70b4d39
No related branches found
No related tags found
No related merge requests found
...@@ -268,6 +268,7 @@ func (c *Client) buildRequest(method string, body io.Reader) (*http.Request, err ...@@ -268,6 +268,7 @@ func (c *Client) buildRequest(method string, body io.Reader) (*http.Request, err
func (c *Client) buildClient() http.Client { func (c *Client) buildClient() http.Client {
client := http.Client{Timeout: time.Duration(c.ClientTimeout) * time.Second} client := http.Client{Timeout: time.Duration(c.ClientTimeout) * time.Second}
transport := &http.Transport{ transport := &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{ DialContext: (&net.Dialer{
// Default is 30s. // Default is 30s.
Timeout: 10 * time.Second, Timeout: 10 * time.Second,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment