]> Sergey Matveev's repositories - btrtrc.git/blobdiff - client.go
Drop support for go 1.20
[btrtrc.git] / client.go
index f1a054abc6708a223e3c4159de7e53cb0c35ce84..1ea1d610482551bfef1d621f0ba03bd5cf6f3667 100644 (file)
--- a/client.go
+++ b/client.go
@@ -203,13 +203,16 @@ func (cl *Client) init(cfg *ClientConfig) {
        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,
-               },
+               }
        }
 }