fix(speedtest): 端点节点目标穿隧道解析,消除国内 DNS geo 偏差致 WARP/WG 测速超时#280
Merged
Conversation
根因(Mac 真机 debug 坐实):测速临时 config 对端点(WG/WARP,L3)——sing-box 强制本地解析目标域名 (gstatic),经 default_domain_resolver=dns-direct(223.5.5.5 国内 DNS)解出国内 geo 镜像 IP (180.163.x)→ 境外 WARP 出口回连中国 → 超时(000/12s,时灵时死)。代理节点无此问题(目标 ATYP=domain 透传给出口远程解析、「解析不变量」成立、延迟真实——真机+源码双证)。旧注释把代理语义误推到全类型,对端点从不成立。 修复(按 isEndpointProtocol 键控,未来端点类型自动覆盖):端点用双形态测速—— - exit 形态入站:目标解析经 inbound 键控 dns.rule 定向到穿本节点隧道的 1.1.1.1(anycast 出口就近应答→geo 正确),优先 - local 形态入站:回落 dns-direct(救国内出口 WG——穿隧道查 1.1.1.1 会 anycast 落境外、墙内不可达) 双测并行(≤8s)、exit 优先而非先到先得(local 本机解析恒先到)。代理节点路径零改动;outbound builder 零改 (endpoint domain_resolver 只管 peer 地址、改它 peer 解析死锁 FATAL,已反证)。 真机验证(修复后):WARP exit 形态 gstatic→142.251.24.94(Google edge)→204/0.56s(修复前超时); local 形态→180.163.x 国内镜像(国内出口兜底)。 Fable 深度调研设计。单测:端点双入站/穿隧道 dns server(detour)/inbound 键控 rule(disable_cache/strategy)/ 纯代理零变化 4 例。gate 2904 绿。Tailscale 维持排除(冷启动 2-10s>8s 预算/双会话冲突/DERP 期延迟无意义)。
Sway-Chan
added a commit
that referenced
this pull request
Jul 9, 2026
#280 用双形态(exit-DNS 1.1.1.1 穿隧道 + local-DNS dns-direct 兜底 + 双入站 + 双测竞速) 救端点(WG/WARP)测速的国内 DNS geo 偏差。实测发现 223.5.5.5(AliDNS,有大陆节点 + ECS) 穿隧道解析可按出口地理返 IP,单形态即覆盖境内外出口: - 境外出口(WARP)→ 境外 IP(142.251.x),可达 - 国内出口(自建 WG)→ 国内 IP(58.63.x),可达 1.1.1.1 因 anycast 无大陆 PoP、在国内出口反挂(返境外 IP 墙内不可达),故弃用。 据此把端点测速临时 config 收敛为单一 dns-exit-<id8>(223.5.5.5,detour 穿本端点隧道), 经 inbound 键控 dns.rule 定向;删除 local 兜底入站、endpointLocalPortMap、双测竞速。 代理节点路径零变化(仍以 ATYP=domain 透传出口远程解析)。 真机双证(Mac,部署产物 UI 端到端):Cloudflare WARP 116ms、Dalutone-SZ(国内出口)43ms, 均取真实延迟;纯代理控制组 Hk01 33ms 不受影响。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
根因(Mac 真机 debug 坐实)
测速临时 config 对端点(WG/WARP,L3):sing-box 强制本地解析目标域名(gstatic)→ 经
default_domain_resolver: dns-direct(223.5.5.5 国内 DNS)→ 国内 geo 镜像 IP(180.163.x)→ 境外 WARP 出口回连中国 → 超时(000/12s,时灵时死)。代理节点无此问题:目标
ATYP=domain透传给出口远程解析(「解析不变量」成立、延迟真实)——真机 vless+reality debug + sing-box 源码双证。旧注释把代理语义误推到全类型;对端点从不成立。修复(isEndpointProtocol 键控)
端点双形态测速:
inbound键控dns.rule定向到「穿本节点隧道」的 1.1.1.1(anycast 出口就近应答 → geo 正确),优先dns-direct(救国内出口 WG——穿隧道查 1.1.1.1 会 anycast 落境外、墙内不可达)disable_cache(多端点并测防互污染)domain_resolver只管 peer 地址、改它 peer 解析死锁 FATAL,已反证)真机验证
修复后 WARP:exit 形态 gstatic→
142.251.24.94(Google edge)→204/0.56s(修复前超时);local 形态→180.163.x 国内镜像(国内出口兜底路径)。Tailscale
同型 bias,本修复自动覆盖(isEndpointProtocol);但维持排除——冷启动 2-10s > 8s 预算 / 双会话冲突 / DERP 期延迟无意义。
Fable 深度调研设计。单测 4 例(双入站/穿隧道 dns/inbound 键控 rule/纯代理零变化)。gate tsc+eslint+jest 2904 绿。