Registers a wsl-proxy ctx.web fetch provider so official web_fetch uses undici ProxyAgent through HTTP(S)_PROXY instead of connecting from WSL to a DNS-pinned public IP (the official path that produces TypeError: fetch failed behind a Windows proxy).
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:173787247/dsh-wsl-fetch
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
Kit: dsh-wsl-kit. Use
KIT_SET=dailyorllm(both install this plugin).
Version / Works-with one-liner: see Compatibility below (kept in sync with dsh-wsl-kit).
DeepSeek Harness plugin: make official web_fetch use the Windows HTTP proxy from WSL.
Where it sits
Sends the official web_fetch through the Windows HTTP proxy. dsh-wsl-net only diagnoses; this plugin does the fetch.
flowchart LR
agent["web_fetch"] --> fetch["dsh-wsl-fetch"] --> proxy["Windows HTTP proxy"] --> web["HTTPS"]
Suite diagram and version snapshot: dsh-wsl-kit. This plugin is 0.1.2 (daily; also in llm). Do not copy that matrix into this README.
Compatibility
| Field | Value |
|---|---|
| Plugin | dsh-wsl-fetch 0.1.2 |
| Minimum dsh | ≥ 0.1.2 (web UI one-shot ?token= on Windows relay :3081) |
| Latest verified | See dsh-wsl-kit Compatibility (currently 0.2.0-rc.2) — single source of truth for the suite |
| Kit set | daily (also in github / full; fetch+net also in llm) |
| Cloud Flash | Use model id deepseek-flash (V4.1 Flash) in ~/.dsh/settings.yaml / llm-deepseek — not configured by this plugin |
| Agent Teams | Upstream experimental; not required here |
Suite floor versions: kit check-plugin-versions.sh. Fault tree: TROUBLESHOOTING.md.
Scope: in-process official web_fetch via undici ProxyAgent. Requires HTTP(S)_PROXY. Cloudflare 403/1010 through Clash needs a DIRECT rule — outside this plugin.
Why
Official dsh-web-fetch-http resolves DNS in WSL, then connects directly to that public IP with a custom undici Agent. That bypasses NODE_USE_ENV_PROXY. DeepSeek API can work (global fetch + proxy) while Mattermost/docs web_fetch fails with TypeError: fetch failed.
dsh-wsl-net only injects proxy env into child bash/npm. It cannot fix in-process web_fetch.
This plugin registers fetch provider wsl-proxy and, when HTTPS_PROXY / HTTP_PROXY is set, selects it so web_fetch uses undici ProxyAgent.
Private/localhost URLs stay blocked.
Install
dsh plugin --profile web add github:173787247/dsh-wsl-fetch
Or via kit: KIT_SET=daily bash install.sh (includes this plugin).
Local checkout:
dsh plugin --profile web add /path/to/dsh-wsl-fetch
Restart with kit restart-dsh-web.sh (NODE_USE_ENV_PROXY=1 + proxy env). Open a new session.
Awesome listing: awesome-dsh-plugin entry (#4736 merged).
Config
- id: dsh-wsl-fetch
name: dsh-wsl-fetch
config:
timeoutMs: 30000
maxRedirects: 5
retries: 2
retryDelayMs: 400
| Key | Default | Meaning |
|---|---|---|
timeoutMs |
30000 |
Fetch deadline |
maxRedirects |
5 |
Same-site redirects (www ↔ apex allowed) |
retries |
2 |
Extra attempts after transient proxy/network failure |
retryDelayMs |
400 |
Base delay between retries (× attempt) |
maxResponseBytes |
5000000 |
Body byte cap |
maxBodyChars |
100000 |
Decoded char cap |
userAgent |
product UA | Request User-Agent |
If HTTP(S)_PROXY is missing, the plugin stays registered but unavailable; official http remains selected.
What success / failure look like
- Log:
[dsh-wsl-fetch] web_fetch via proxy (...:port) provider=wsl-proxy→ provider is active. - Red fetch UI with that log line → per-URL proxy/TLS/site failure (retry another source). Not “plugin missing”.
- Cloudflare 403 / 1010 through Clash → site WAF; add Clash DIRECT for that host. This plugin cannot override WAF.
Test
npm test
# live proxy path (same as dsh web_fetch)
bash scripts/stress.sh
Changelog
See CHANGELOG.md.
License
MIT
Links
More in this category
6Mikao9/dsh-wsl-workspace★ 100
Add a WSL workspace from the web GUI without needing to install dsh or related tools again inside WSL. Bash commands and file read/write operations run within the local WSL distribution on the host machine, while Windows files remain accessible.
XINY11451/dsh-wsl★ 7
Extends the working range of DSH into WSL. Files in the distribution can be read, written, edited and searched by DSH directly. Depending on the task, the AI chooses for itself: run a one-off command, or open its own terminal and run several commands there to finish the job. Typing `dsh` in a WSL terminal calls DSH (type `dsh help` there for details), fusing WSL and DSH deeply. Every terminal you open can collaborate visually with the AI.
Edge-Echo/dsh-win-toolkit★ 4
Windows-native tools for DSH agents: clipboard read and write, system notifications, hosts file inspection and network diagnostics, each returning structured data with UI cards from injection-safe PowerShell.
173787247/dsh-wsl-env★ 3
Injects WSL distro, Linux path mapping, /mnt/c CRLF and git caveats, and NODE_USE_ENV_PROXY into the system prompt.
173787247/dsh-wsl-open★ 3
Opens WSL Linux paths from DeepSeek Harness chat in the Windows default app or Explorer.
Han-1413141/dsh-wsl-native★ 3
Use Windows and native Linux DSH sessions in one Windows window, with WSL environment switching and bidirectional system tools.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.