cl.event.L = cl.locker()
cl.ipBlockList = cfg.IPBlocklist
cl.httpClient = &http.Client{
- Transport: &http.Transport{
+ Transport: cfg.WebTransport,
+ }
+ if cl.httpClient.Transport == nil {
+ cl.httpClient.Transport = &http.Transport{
Proxy: cfg.HTTPProxy,
DialContext: cfg.HTTPDialContext,
// I think this value was observed from some webseeds. It seems reasonable to extend it
// to other uses of HTTP from the client.
MaxConnsPerHost: 10,
- },
+ }
}
}
Debug bool `help:"enable debugging"`
Logger log.Logger
+ // Used for torrent sources and webseeding if set.
+ WebTransport http.RoundTripper
// Defines proxy for HTTP requests, such as for trackers. It's commonly set from the result of
// "net/http".ProxyURL(HTTPProxy).
HTTPProxy func(*http.Request) (*url.URL, error)