Skip to content

Commit

Permalink
Increase default TCP timeout (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe authored Sep 22, 2020
1 parent 4f94ba0 commit ddb488c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ const (
defaultMaxRedirections = 64
defaultTimeout = 10 * time.Second
agentName = "muffet"
tcpTimeout = time.Minute
)
5 changes: 4 additions & 1 deletion fasthttp_http_client_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"crypto/tls"
"net"

"github.com/valyala/fasthttp"
)
Expand All @@ -21,7 +22,9 @@ func (*fasthttpHTTPClientFactory) Create(o httpClientOptions) httpClient {
TLSConfig: &tls.Config{
InsecureSkipVerify: o.SkipTLSVerification,
},
},
Dial: func(addr string) (net.Conn, error) {
return fasthttp.DialTimeout(addr, tcpTimeout)
}},
o.MaxRedirections,
o.Timeout,
)
Expand Down

0 comments on commit ddb488c

Please sign in to comment.