Increase timeouts

This commit is contained in:
世界
2024-10-30 13:09:05 +08:00
parent 419058f466
commit 8c143feec8
6 changed files with 12 additions and 10 deletions

View File

@@ -7,7 +7,6 @@ import (
"net/http"
"os"
"path/filepath"
"time"
"github.com/sagernet/sing-box/adapter"
"github.com/sagernet/sing-box/common/geoip"
@@ -158,7 +157,7 @@ func (r *Router) downloadGeoIPDatabase(savePath string) error {
httpClient := &http.Client{
Transport: &http.Transport{
ForceAttemptHTTP2: true,
TLSHandshakeTimeout: 5 * time.Second,
TLSHandshakeTimeout: C.TCPTimeout,
DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
return detour.DialContext(ctx, network, M.ParseSocksaddr(addr))
},
@@ -213,7 +212,7 @@ func (r *Router) downloadGeositeDatabase(savePath string) error {
httpClient := &http.Client{
Transport: &http.Transport{
ForceAttemptHTTP2: true,
TLSHandshakeTimeout: 5 * time.Second,
TLSHandshakeTimeout: C.TCPTimeout,
DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
return detour.DialContext(ctx, network, M.ParseSocksaddr(addr))
},