wqzhellohhwy/dsh-web-fetch-lan ↗★ 0
@local/dsh-web-fetch-lan
web_fetch provider that tolerates Clash/mihomo fake-ip answers (default 198.18.0.0/15, 2001:2::/64; configurable via config.fakeIpRanges / fakeIpRanges6) while still refusing private and reserved addresses 适合在使用Clash/mihomo等代理且开启fake-ip时,网页抓取功能失效的用户。
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:wqzhellohhwy/dsh-web-fetch-lanREADME
Read the full README ↗配置
fake-ip 段在 loader 行的 config 里配置,默认值写在 cordis.patch.yml:
- insert:
- id: web-fetch-lan
name: '@local/dsh-web-fetch-lan'
config:
fakeIpRanges:
- 198.18.0.0/15
fakeIpRanges6:
- 2001:2::/64
- fdfe:dcba:9876::/64
在 Clash Verge 里改了 fake-ip-range / fake-ip-range6 之后,把新段补进这里,重启 DSH 即可,不用改代码。
不想改本仓库文件的话,在 profile 层覆盖(~/.dsh/profiles/ /cordis.patch.yml):
- id: web-fetch-lan
config:
fakeIpRanges: ['198.18.0.0/15']
fakeIpRanges6: ['2001:2::/64']
容错规则:条目逐个做 CIDR 校验,非法条目剔除后保留其余;非数组、或全部非法时回退内置默认段并在日志告警——不会因为配置写错而静默放行一切。生效的段会在启动日志里打印一行:
[web-fetch-lan] fake-ip 段 v4=198.18.0.0/15 v6=2001:2::/64,fdfe:dcba:9876::/64
cordis.patch.yml 里另有一条把 web 条的 fetchProvider 固定为 http-lan:内置的 web-fetch-http 依然注册着,不显式指定会得到 WEB_PROVIDER_AMBIGUOUS。