mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-02 11:15:03 +03:00
fix(net): stop per-request clients parking connections to remote hosts
The node certificate probe builds a transport for one request and dropped it with the connection still parked, and the remote routing client kept idle connections with no timeout; either stayed open for as long as the remote side wanted. Close the probe's idle connections when it returns, and turn keep-alive off for routing downloads, which are minutes apart. The routing client dials only public hosts, so no loopback test reaches it; TestFetchCertFingerprintLeavesNoIdleConnection covers the probe.
This commit is contained in:
@@ -486,7 +486,9 @@ func newRemoteRoutingHTTPClient() *http.Client {
|
||||
ForceAttemptHTTP2: true,
|
||||
TLSHandshakeTimeout: 4 * time.Second,
|
||||
ResponseHeaderTimeout: 5 * time.Second,
|
||||
TLSClientConfig: &tls.Config{MinVersion: tls.VersionTLS12},
|
||||
// Downloads are minutes apart, and a parked connection lives as long as the host likes.
|
||||
DisableKeepAlives: true,
|
||||
TLSClientConfig: &tls.Config{MinVersion: tls.VersionTLS12},
|
||||
}
|
||||
return &http.Client{
|
||||
Timeout: remoteRoutingHTTPTimeout,
|
||||
|
||||
Reference in New Issue
Block a user