(maxIdle, maxIdlePerHost int)
| 38 | } |
| 39 | |
| 40 | func buildHTTPTransport(maxIdle, maxIdlePerHost int) http.RoundTripper { |
| 41 | transport := http.DefaultTransport.(*http.Transport).Clone() |
| 42 | transport.DisableKeepAlives = false |
| 43 | transport.MaxIdleConns = maxIdle |
| 44 | transport.MaxIdleConnsPerHost = maxIdlePerHost |
| 45 | transport.ForceAttemptHTTP2 = false |
| 46 | transport.DisableCompression = true |
| 47 | return transport |
| 48 | } |