fix: SOCKS5 dialer 日志改 Info 级别,OAuth 超时延长至 60s

This commit is contained in:
win 2026-04-01 16:54:33 +08:00
parent cc737d789e
commit 47ce45fbed
2 changed files with 6 additions and 6 deletions

View File

@ -141,7 +141,7 @@ func NewSOCKS5ProxyDialer(profile *Profile, proxyURL *url.URL) *SOCKS5ProxyDiale
// DialTLSContext establishes a TLS connection through SOCKS5 proxy with the configured fingerprint. // DialTLSContext establishes a TLS connection through SOCKS5 proxy with the configured fingerprint.
// Flow: SOCKS5 CONNECT to target -> TLS handshake with utls on the tunnel // Flow: SOCKS5 CONNECT to target -> TLS handshake with utls on the tunnel
func (d *SOCKS5ProxyDialer) DialTLSContext(ctx context.Context, network, addr string) (net.Conn, error) { func (d *SOCKS5ProxyDialer) DialTLSContext(ctx context.Context, network, addr string) (net.Conn, error) {
slog.Debug("tls_fingerprint_socks5_connecting", "proxy", d.proxyURL.Host, "target", addr) slog.Info("tls_fingerprint_socks5_connecting", "proxy", d.proxyURL.Host, "target", addr)
// Step 1: Create SOCKS5 dialer // Step 1: Create SOCKS5 dialer
var auth *proxy.Auth var auth *proxy.Auth
@ -166,18 +166,18 @@ func (d *SOCKS5ProxyDialer) DialTLSContext(ctx context.Context, network, addr st
tcpDialer := &net.Dialer{} tcpDialer := &net.Dialer{}
socksDialer, err := proxy.SOCKS5("tcp", proxyAddr, auth, tcpDialer) socksDialer, err := proxy.SOCKS5("tcp", proxyAddr, auth, tcpDialer)
if err != nil { if err != nil {
slog.Debug("tls_fingerprint_socks5_dialer_failed", "error", err) slog.Info("tls_fingerprint_socks5_dialer_failed", "error", err)
return nil, fmt.Errorf("create SOCKS5 dialer: %w", err) return nil, fmt.Errorf("create SOCKS5 dialer: %w", err)
} }
// Step 2: Establish SOCKS5 tunnel to target // Step 2: Establish SOCKS5 tunnel to target
slog.Debug("tls_fingerprint_socks5_establishing_tunnel", "target", addr) slog.Info("tls_fingerprint_socks5_establishing_tunnel", "target", addr)
conn, err := socksDialer.(proxy.ContextDialer).DialContext(ctx, "tcp", addr) conn, err := socksDialer.(proxy.ContextDialer).DialContext(ctx, "tcp", addr)
if err != nil { if err != nil {
slog.Debug("tls_fingerprint_socks5_connect_failed", "error", err) slog.Info("tls_fingerprint_socks5_connect_failed", "error", err)
return nil, fmt.Errorf("SOCKS5 connect: %w", err) return nil, fmt.Errorf("SOCKS5 connect: %w", err)
} }
slog.Debug("tls_fingerprint_socks5_tunnel_established") slog.Info("tls_fingerprint_socks5_tunnel_established", "target", addr)
// Step 3: Perform TLS handshake on the tunnel with utls fingerprint // Step 3: Perform TLS handshake on the tunnel with utls fingerprint
return performTLSHandshake(ctx, conn, d.profile, addr) return performTLSHandshake(ctx, conn, d.profile, addr)

View File

@ -279,7 +279,7 @@ func createReqClient(proxyURL string) (*req.Client, error) {
} }
client := req.C(). client := req.C().
SetTimeout(30 * time.Second). SetTimeout(60 * time.Second).
SetCookieJar(nil). // 禁用 CookieJar确保每次授权都是干净的会话 SetCookieJar(nil). // 禁用 CookieJar确保每次授权都是干净的会话
EnableForceHTTP1() // 强制 HTTP/1.1,避免 H2 升级与自定义 TLS dialer 冲突 EnableForceHTTP1() // 强制 HTTP/1.1,避免 H2 升级与自定义 TLS dialer 冲突