Skip to content

Commit

Permalink
🐛 fix: incorrect timeout time cited
Browse files Browse the repository at this point in the history
  • Loading branch information
MartialBE committed Apr 19, 2024
1 parent 4527e1e commit 7511d61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/requester/http_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func proxyFunc(req *http.Request) (*url.URL, error) {
func socks5ProxyFunc(ctx context.Context, network, addr string) (net.Conn, error) {
// 设置TCP超时
dialer := &net.Dialer{
Timeout: time.Duration(common.GetOrDefault("CONNECT_TIMEOUT", 5)) * time.Second,
Timeout: time.Duration(common.GetOrDefault("connect_timeout", 5)) * time.Second,
KeepAlive: 30 * time.Second,
}

Expand Down Expand Up @@ -74,7 +74,7 @@ func InitHttpClient() {
Transport: trans,
}

relayTimeout := common.GetOrDefault("connect_timeout", 600)
relayTimeout := common.GetOrDefault("relay_timeout", 600)
if relayTimeout != 0 {
HTTPClient.Timeout = time.Duration(relayTimeout) * time.Second
}
Expand Down

0 comments on commit 7511d61

Please sign in to comment.