Back to home@173787247

dsh-wsl-fetch

Proxy-aware web_fetch for WSL: official web_fetch through Windows HTTP_PROXY instead of a DNS-pinned public IP.

Stars
1
Language
JavaScript
Created
Sep 9, 2026
Updated
Sep 10, 2026
GitHub repo

Introduction

dsh-wsl-fetch

Kit: dsh-wsl-kit. Use KIT_SET=daily.

DeepSeek Harness plugin: make official web_fetch use the Windows HTTP proxy from WSL.

中文说明 ↓

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 a local checkout:

dsh plugin --profile web add /path/to/dsh-wsl-fetch

Restart dsh web with NODE_USE_ENV_PROXY=1 and your proxy env (see dsh-wsl-kit restart-dsh-web.sh). Open a new session.

Config

- id: dsh-wsl-fetch
  name: dsh-wsl-fetch
  config:
    timeoutMs: 30000
    maxRedirects: 5
KeyDefaultMeaning
timeoutMs30000Fetch deadline
maxRedirects5Same-site redirects (www ↔ apex allowed)
retries2Extra attempts after transient proxy/network failure
retryDelayMs400Base delay between retries (× attempt)
maxResponseBytes5000000Body byte cap
maxBodyChars100000Decoded char cap
userAgentproduct UARequest User-Agent

If HTTP(S)_PROXY is missing, the plugin stays registered but unavailable; official http remains selected.

Test

npm test
# live proxy path (same as dsh web_fetch)
bash scripts/stress.sh

License

MIT


中文

官方 web_fetch 在 WSL 里先 DNS、再直连公网 IP,不走 Windows 上的 Clash。于是 API 通、抓网页失败。

本插件在有 HTTPS_PROXY 时把 web_fetch 切到 wsl-proxy(undici ProxyAgent)。仍拒绝内网 / localhost。

安装后重启 dsh web新开会话