(proxyURL string)
| 74 | } |
| 75 | |
| 76 | func newProxiedClient(proxyURL string) *http.Client { |
| 77 | u, _ := url.Parse(proxyURL) |
| 78 | return &http.Client{ |
| 79 | Timeout: 9 * time.Second, |
| 80 | Transport: &http.Transport{ |
| 81 | Proxy: http.ProxyURL(u), |
| 82 | }, |
| 83 | CheckRedirect: func(req *http.Request, via []*http.Request) error { |
| 84 | if len(via) >= 5 { |
| 85 | return http.ErrUseLastResponse |
| 86 | } |
| 87 | return nil |
| 88 | }, |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | func findLocalProxyPort(configJSON string) string { |
| 93 | if configJSON == "" { |