Preface¶
In DeepSeek Harness (DSH), web_fetch parses the hostname before a direct connection and validates that every address in the resolution result is a globally reachable public unicast address; otherwise, it throws WEB_BLOCKED_URL. When Clash or mihomo runs with TUN and enhanced-mode: fake-ip, the system DNS returns addresses from the fake-ip pool (e.g., IPv4 defaults to 198.18.0.0/15). These segments are marked as reserved by libraries like ipaddr, so validation inevitably fails. On the same machine, browsers, curl, and web_search often still work—only web_fetch fails—because this public address validation only exists in the @deepseek-ai/dsh-web-fetch-http chain.
Common workarounds include changing Clash DNS to redir-host, disabling TUN, or setting proxy environment variables. The community plugin dsh-web-fetch-fakeip (maintainer wjj-8283, npm package @wjj-8283/dsh-web-fetch-fakeip) takes another path: it does not add a provider or change Clash configuration; instead, it precisely allows reserved segments in fake-ip scenarios, leaving other SSRF protections unchanged.
What is this¶
dsh-web-fetch-fakeip is a Cordis plugin for DSH that applies a reversible patch to the address resolution step of @deepseek-ai/dsh-web-fetch-http (provider id http). The goal is clear: under TUN + fake-ip, web_fetch no longer fails entirely because “resolved to a non-public IP”; without fake-ip, the plugin remains inert and behaves exactly as if it were not installed.
Comparison example from the README:
Before fix: Error: URL hostname "mpv.io" resolves to a non-public IP address
After fix: Fetched https://mpv.io/manual/master/ (HTTP 200)
Where the problem comes from¶
After resolution, dsh-web-fetch-http checks whether each entry.address is a public address; if not, it throws an error with WEB_BLOCKED_URL. In fake-ip mode, getaddrinfo returns addresses generated on the TUN side; the connection can still be proxied by Clash, which reverse-queries the domain from the fake-ip and connects on behalf of the client, with TLS SNI remaining the original hostname. However, the validation happens before the connection.
Another detail: in the resolution result, IPv4 and AAAA may both be fake IPs. The validation is “if any address in the result set is invalid, reject the whole set.” Therefore, exempting only IPv4 segments is insufficient; the IPv6 fake-ip pool must also be covered.
Core features¶
The plugin does not add a fetch provider and does not require changes to DSH or Clash global configuration. The implementation wraps the resolveAddresses method on the HttpFetchProvider instance:
- Original logic first—call the original resolver first; if it returns normally, return the result as-is.
- Only when the original logic rejects with
WEB_BLOCKED_URL, and a re-resolution confirms that the entire group of addresses falls within the configured fake-ip reserved segments, is that group allowed. - If any address in the result is not in a fake-ip segment (real public IP, internal network,
169.254.169.254,::1, Tailscale CGNAT100.64.0.0/10, etc.), it is still rejected by the original logic.
Default exempted CIDRs (all reserved segments that should not be used as real destinations on the public internet, consistent with common defaults in Clash / mihomo / Clash Verge):
| Segment | Description |
|---|---|
198.18.0.0/15 |
RFC 2544; default fake-ip IPv4 range for Clash / mihomo |
fdfe:dcba:9876::/64 |
Common fake-ip-range6 in Clash Verge |
2001:2::/48 |
RFC 5180; corresponds to another IPv6 fake-ip configuration in Verge |
When the plugin is disabled or reloaded, the wrapped provider reverts to its original behavior (if other code replaced resolveAddresses meanwhile, it will not roll back, to avoid overwriting someone else’s patch).
On the GUI side, a fake-ip direct fix item is added to the “Settings” navigation, where you can toggle the plugin and edit the address segment list; reads and writes go to the Cordis patch of the current profile, and the server can hot-reload, so no separate dsh restart is required just to change configuration (installing/uninstalling the plugin itself still requires a restart per the README).
Installation and activation¶
Replace <profile> with the DSH profile name you actually use. The plugin runs with the permissions of the current dsh process; before installing, it is recommended to review the GitHub repository source code and the MIT license.
Install from npm (recommended)¶
dsh plugin --profile <profile> add @wjj-8283/dsh-web-fetch-fakeip
Restart dsh after installation.
Install from GitHub¶
dsh plugin --profile <profile> add github:wjj-8283/dsh-web-fetch-fakeip-plugin
Restart dsh after installation.
Local link development¶
For local debugging, clone the repository and install with a link: path (README method C); for everyday users, the two add methods above suffice.
Optional configuration¶
In the GUI fake-ip direct fix, you can change enabled and the CIDR lines; you can also directly edit the profile’s patch layer, e.g., $DSH_HOME/profiles/<profile>/cordis.patch.yml:
- id: web-fetch-fakeip
config:
enabled: true
fakeIpRanges:
- 198.18.0.0/15
- fdfe:dcba:9876::/64
- 2001:2::/48
enabled: false can pause the plugin without uninstalling it. Invalid CIDRs will be logged as errors and fall back to the default segments, to avoid a single typo causing the plugin entry to fail to load and the settings page to fail to open.
Typical usage and verification¶
After installing and restarting dsh, in a Clash / mihomo environment still using TUN + fake-ip, call web_fetch again on a URL that previously reported non-public IP address; it should return HTTP 200 and the body normally. The README uses https://mpv.io/manual/master/ as a before/after comparison; locally you can retest with any external link that was previously blocked.
At the same time, confirm that SSRF-related addresses are still rejected (the README screenshots show that loopback and cloud metadata addresses are still rejected after the fix), indicating that the exemption scope is limited to fake-ip reserved segments.
Applicable scenarios and notes¶
Who it is for: Those who keep Clash / mihomo TUN + fake-ip enabled on the local machine long-term and want web_fetch in DSH agents to fetch public pages like browsers do, without changing DNS mode, disabling TUN, or stacking proxy environment variables for DSH alone.
Known boundaries (from the README):
- It only patches the
httpweb_fetchprovider; if the upstream changes theresolveAddressesinjection point, the plugin may silently fail (the startup log will show “Taken over 0”). - Conservative decision: if any non-fake-ip address is mixed into a resolution result, rejection is maintained; under normal fake-ip deployments, mixed results usually do not occur.
- If addresses within the fake-ip segments are actually used by public services, they will be allowed as well; RFC 2544 / RFC 5180 related segments are not used as public destinations in practice.
- At runtime, it relies on Node’s built-in
node:netBlockListfor CIDR matching;package.jsonrequires Node>=22.19.
Uninstall: To temporarily disable, set enabled: false in the patch. To completely remove npm / GitHub installed packages:
dsh plugin --profile <profile> remove @wjj-8283/dsh-web-fetch-fakeip
Whether disabling or uninstalling, the README requires a restart of dsh.
Ending¶
dsh-web-fetch-fakeip solves the inconsistency between web_fetch in DSH and system DNS behavior under Clash TUN + fake-ip: with a minimal, reversible patch at the resolution layer, it only allows fake-ip reserved segments and does not weaken protection against internal network and metadata addresses. The plugin belongs to the DSH community ecosystem (directory sites and DeepSeek / High-Flyer have no official affiliation) and can be obtained from community directories or GitHub as needed.
- Directory page: https://www.skillhub.cn/plugins/wjj-8283/dsh-web-fetch-fakeip-plugin
- GitHub: https://github.com/wjj-8283/dsh-web-fetch-fakeip-plugin