mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
Add idle conn timeout for HTTP transport
Allowing the connection to be re-new once it becomes un-usable.
This commit is contained in:
committed by
Cuong Manh Le
parent
2e1b3f9d07
commit
8852f60ccb
@@ -157,6 +157,7 @@ func (uc *UpstreamConfig) SetupTransport() {
|
||||
|
||||
func (uc *UpstreamConfig) setupDOHTransport() {
|
||||
uc.transport = http.DefaultTransport.(*http.Transport).Clone()
|
||||
uc.transport.IdleConnTimeout = 5 * time.Second
|
||||
uc.transport.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||
dialer := &net.Dialer{
|
||||
Timeout: 10 * time.Second,
|
||||
|
||||
Reference in New Issue
Block a user