You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
开启 Clash/Mihomo 类代理客户端的 fake-ip 模式(TUN +
enhanced-mode: fake-ip,即 Clash 系默认配置)后,web_fetch对所有域名一律失败:失败率 100%,与目标域名、域名归属地、站点实际可达性均无关。报错文本没有任何线索指向 DNS 已被代理接管,用户难以自诊——本次排查先后怀疑过网络故障、代理未生效、目标站点被墙,数轮之后才定位到根因。
需要先说明:
network.ts的公网地址校验是有意且正确的安全设计,本报告不建议放宽它。 问题在于 fake-ip 是 Clash 系的默认配置,命中后既没有可诊断的报错,也没有文档化的出口。Reproduction
环境:macOS + Clash Verge Rev,TUN 模式(
tun.enable: true+dns-hijack: any:53),enhanced-mode: fake-ip,fake-ip-range: 198.18.0.1/16。不依赖具体客户端:任何使 DNS 应答落在 RFC 2544 保留段
198.18.0.0/15的配置都能复现。web_fetch抓任意 URL:对照实验(同一会话、同一时刻、同一条网络)
web_search"google"web_fetchhttps://damodev.csdn.net/resolves to a non-public IP addressweb_fetchhttps://www.google.com/web_fetchhttps://www.baidu.com/web_fetch(关闭 VPN 后)https://damodev.csdn.net/HTTP 200www.baidu.com同样失败,可排除"墙"或域名归属地的解释;web_search成功,可排除网络故障。Current behavior
packages/web/web-fetch-http/src/network.ts在建立连接之前解析域名并逐个校验应答:isPublicIpAddress()用ipaddr.js的range()判定,要求结果等于'unicast'。fake-ip 分配的地址落在198.18.0.0/15:于是校验在发包前就拒绝,TUN 无从接管——一个数据包都没有发出。
版本敏感点:仓库
.pnpm下同时存在ipaddr.js@1.9.1与2.5.0,两者对该段的分类不同——1.9.1判为unicast(放行),2.5.0判为reserved(拒绝)。web-fetch-http声明^2.5.0,故当前行为是拒绝。也就是说该行为随依赖升级而变,建议用测试固定。为什么
web_search不受影响web-search-deepseek/src/provider.ts:225用原生fetch直接发请求,全程不检查解析结果,198.18.x.x对它只是透明标签(实测其api.deepseek.com同样解析到198.18.3.5,工作正常)。全仓resolvePublicAddresses仅被web-fetch-http使用。同理,Claude Code、Codex、curl、浏览器等不做 IP 校验的工具在同一环境下均正常——这是 DSH 独有的失败模式。
Expected behavior
不改变安全不变量,只补上可诊断性与出口:
198.18.0.0/15时,在报错中说明这通常是代理 fake-ip 模式所致,并给出可操作提示:切换 Clash 的enhanced-mode为redir-host,或设置HTTPS_PROXY走代理分支。packages/web/web-fetch-http/README.md目前未提及此环境下的失败模式。已存在但未文档化的逃生通道:设置
HTTPS_PROXY后,provider.ts:134的proxyRouteFor(url)会判定为 proxied,走requestVia跳过本机解析与 pinning,由代理完成真实解析。本次经~/.dsh/.env配置HTTPS_PROXY=http://127.0.0.1:7897后实测有效:同一 URL 返回HTTP 200,https://www.google.com/返回HTTP 302。Environment
deepseek-ai/deepseek-harness@master@deepseek-ai/dsh-web-fetch-http,依赖ipaddr.js@2.5.0enhanced-mode: fake-ip,fake-ip-range: 198.18.0.1/16,mixed-port: 7897All reactions