dsh-wsl-fetch
在终端中运行以下命令:
dsh plugin install 173787247/dsh-wsl-fetch
将以下提示词粘贴到 DeepSeek Harness 对话框中:
在 DeepSeek Harness 中执行 dsh plugin install 173787247/dsh-wsl-fetch 即可安装(源码:https://github.com/173787247/dsh-wsl-fetch)
插件介绍
When dsh runs inside WSL, its built-in web_fetch resolves DNS on the Linux side and then connects directly to the target public IP, completely bypassing whatever HTTP proxy is already configured on the Windows host. DeepSeek API calls still work, yet fetching a Mattermost page or a documentation site throws TypeError: fetch failed. The companion plugin dsh-wsl-net only injects proxy environment variables into child bash or npm processes and cannot patch the in-process fetch path.
dsh-wsl-fetch registers a fetch provider called wsl-proxy. When HTTP_PROXY or HTTPS_PROXY is detected, the provider is selected automatically and routes the request through an undici ProxyAgent pointed at the Windows-side proxy. It also exposes tunable knobs—timeout, max redirects, retry count, retry delay, response body byte cap, decoded character cap, and User-Agent—so fetch behavior stays predictable. If the proxy variables are absent, the plugin remains registered but marked unavailable and the stock http provider continues as the fallback.
This plugin is aimed at users who run dsh in WSL 2 and rely on a Windows proxy such as Clash to reach external sites. It does not override Cloudflare WAF blocks (403 / 1010) and keeps private or localhost URLs blocked; those cases still need proxy rules or site-side cooperation.
使用场景
- WSL 中 web_fetch 直连公网 IP 导致连接失败
- Clash 代理下抓取外网文档或 Mattermost 页面报错
- dsh-wsl-net 只能注入子进程代理而无法修复的进程内 fetch
适合人员
- 在 WSL 2 中运行 dsh 并需要访问外网的用户
- 依赖 Clash 或 Windows 侧 HTTP(S)_PROXY 的网络环境
- 遇到 web_fetch TypeError: fetch failed 报错的开发者