mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-08-10 13:20:33 +02: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:
@@ -157,6 +157,7 @@ func (uc *UpstreamConfig) SetupTransport() {
|
|||||||
|
|
||||||
func (uc *UpstreamConfig) setupDOHTransport() {
|
func (uc *UpstreamConfig) setupDOHTransport() {
|
||||||
uc.transport = http.DefaultTransport.(*http.Transport).Clone()
|
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) {
|
uc.transport.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||||
dialer := &net.Dialer{
|
dialer := &net.Dialer{
|
||||||
Timeout: 10 * time.Second,
|
Timeout: 10 * time.Second,
|
||||||
|
|||||||
Reference in New Issue
Block a user