fix: Node.js TLS 代理仅拦截 Anthropic 请求(DoWithTLS 路径)
Some checks failed
CI / test (push) Failing after 4s
CI / golangci-lint (push) Failing after 4s
Security Scan / backend-security (push) Failing after 4s
Security Scan / frontend-security (push) Failing after 5s

- Do() 去掉 Node.js 代理拦截,Antigravity/Google 请求走原路径
- 只有 DoWithTLS 且 enableTLSFingerprint=true 时走 Node.js 代理
- 按平台分治:Anthropic → Node.js 原生 TLS,Google → 原有 uTLS/直连
This commit is contained in:
win 2026-03-22 02:25:40 +08:00
parent 5d476fbc09
commit 3673936cb3

View File

@ -124,11 +124,6 @@ func NewHTTPUpstream(cfg *config.Config) service.HTTPUpstream {
// - 调用方必须关闭 resp.Body否则会导致 inFlight 计数泄漏 // - 调用方必须关闭 resp.Body否则会导致 inFlight 计数泄漏
// - inFlight > 0 的客户端不会被淘汰,确保活跃请求不被中断 // - inFlight > 0 的客户端不会被淘汰,确保活跃请求不被中断
func (s *httpUpstreamService) Do(req *http.Request, proxyURL string, accountID int64, accountConcurrency int) (*http.Response, error) { func (s *httpUpstreamService) Do(req *http.Request, proxyURL string, accountID int64, accountConcurrency int) (*http.Response, error) {
// Node.js TLS 代理:所有 HTTPS 上游请求走 Node.js 代理
if s.isNodeTLSProxyEnabled() && req != nil && req.URL != nil && req.URL.Scheme == "https" {
return s.doViaNodeTLSProxy(req, accountID, accountConcurrency)
}
if err := s.validateRequestHost(req); err != nil { if err := s.validateRequestHost(req); err != nil {
return nil, err return nil, err
} }