fix(proxy): 修复代理深度验证的若干问题

- detector.go: 修复 AutoConfigureProxy 覆盖探测结果的问题
  只有未探测过时才设置默认 proxyReliable 值

- port_scan.go: 改进深度验证机制
  - 使用带 Host header 的 HTTP GET 请求替代 OPTIONS
  - 延长响应等待超时至 2s 以适配慢速服务器
  - 正确重置连接 deadline 避免影响后续操作
This commit is contained in:
ZacharyZcR
2026-01-20 19:43:49 +08:00
parent 0e70cf67c7
commit 26ed83b5cd
2 changed files with 21 additions and 10 deletions
+4 -1
View File
@@ -88,7 +88,10 @@ func AutoConfigureProxy(config *ProxyConfig) {
// SOCKS5代理默认假设非标准(后续由探测函数验证)
if config.Type == ProxyTypeSOCKS5 {
SetSOCKS5Standard(false)
SetProxyReliable(true) // 默认可靠,后续由 ProbeProxyBehavior 更新
// 只有未探测过时才设置默认值,避免覆盖探测结果
if !IsProxyProbed() {
SetProxyReliable(true) // 默认可靠,后续由 ProbeProxyBehavior 更新
}
}
// HTTP/HTTPS代理视为标准且可靠