mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
refactor(proxy-node): 统一代理解析,全面支持 tunnel 模式
新增 resolve_ops_proxy_config 合并 proxy 和 tunnel_node_id 的解析, 避免各架构重复调用 _resolve_effective_node。所有架构连接器 (anyrouter/nekocode/sub2api/yescode) 和 HTTPClientPool 均适配 tunnel 模式,通过 TunnelTransport 替代传统代理。
This commit is contained in:
@@ -204,6 +204,13 @@ class HTTPClientPool:
|
||||
if not proxy_config:
|
||||
proxy_config = get_system_proxy_config()
|
||||
|
||||
# tunnel 模式检查:tunnel 节点走专用的 TunnelTransport 客户端
|
||||
from src.services.proxy_node.resolver import resolve_delegate_config
|
||||
|
||||
delegate_cfg = resolve_delegate_config(proxy_config)
|
||||
if delegate_cfg and delegate_cfg.get("tunnel"):
|
||||
return await cls._get_tunnel_client(delegate_cfg["node_id"])
|
||||
|
||||
cache_key = compute_proxy_cache_key(proxy_config)
|
||||
|
||||
# 无代理时返回默认客户端
|
||||
|
||||
Reference in New Issue
Block a user