torrent.go | 8 +++++++- diff --git a/torrent.go b/torrent.go index 26f49b82a6b289a08e9526d015b5d974db90f902..a4ae4b48c4bb340a310edefa1a67a304038e34e6 100644 --- a/torrent.go +++ b/torrent.go @@ -2103,6 +2103,12 @@ func (t *Torrent) callbacks() *Callbacks { return &t.cl.config.Callbacks } +var WebseedHttpClient = &http.Client{ + Transport: &http.Transport{ + MaxConnsPerHost: 10, + }, +} + func (t *Torrent) addWebSeed(url string) { if t.cl.config.DisableWebseeds { return @@ -2125,7 +2131,7 @@ callbacks: t.callbacks(), }, client: webseed.Client{ // Consider a MaxConnsPerHost in the transport for this, possibly in a global Client. - HttpClient: http.DefaultClient, + HttpClient: WebseedHttpClient, Url: url, }, activeRequests: make(map[Request]webseed.Request, maxRequests),