Open sinylei opened 5 years ago
When you set a proxy, applyProxy will recreate a new Transport. So the connection pool cached in original Transport object will be discarded. So I changed applyProxy in request/proxy_go12.go as below and it works very well for me.
func applyProxy(a *Args) (err error) { if a.Proxy == "" { return nil }
u, err := url.Parse(a.Proxy) if err != nil { return err } switch u.Scheme { case "http", "https", "socks5": a.Client.Transport.(*http.Transport).Proxy = http.ProxyURL(u) } return
}
@sinylei Feel free to send a pull request.
When you set a proxy, applyProxy will recreate a new Transport. So the connection pool cached in original Transport object will be discarded. So I changed applyProxy in request/proxy_go12.go as below and it works very well for me.
func applyProxy(a *Args) (err error) { if a.Proxy == "" { return nil }
}