Open hiranoqueworks opened 2 years ago
I don't remember all those changes. However, I think it may be good to start with default
var transport = http.DefaultTransport
And having a set function for those that need to keep DefaultTransport as it is but want this transport different.
Do you have time help with a PR? I am lack of time and lock of development tools
You can do it that way
var transport = http.DefaultTransport
Can I modify it and pull request?
Yes we can start with it
Request
Reason : I want to use it in a Proxy environment
Make a request connection.go Line:16 var transport = http.Transport{}
Don't initialize with empty, just use DefaultTransport or or add the following function func SetTransport(h http.Transport) { transport = h }
Example : http.DefaultTransport = &http.Transport{ Proxy: http.ProxyURL(proxyUrl) } I want to use defaultTransport and use it around like Or tr := &http.Transport{ ResponseHeaderTimeout: 30 time.Second, Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ Timeout: 2 time.Second, }).DialContext, MaxIdleConns: 0, IdleConnTimeout: 30 time.Second, TLSHandshakeTimeout: 2 time.Second, }), Second, MaxIdleConnsPerHost: 100, //DisableKeepAlives: false, DisableKeepAlives: true, } solr.SetTransport(tr)
Please.