173787247/dsh-wsl-fetch1

dsh-wsl-fetch

WSL环境下的代理感知网页获取插件

AI 分析

使WSL中的网页获取请求通过Windows代理发送,适合WSL环境下的网络代理优化。

包名
dsh-wsl-fetch
版本
0.1.2
许可证
MIT
最近更新
2026年9月12日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:173787247/dsh-wsl-fetch

dsh-wsl-fetch

Kit: dsh-wsl-kit. Use KIT_SET=daily or llm (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.

中文说明 → README.zh.md

Compatibility

FieldValue
Plugindsh-wsl-fetch 0.1.1
Minimum dsh0.1.2 (web UI one-shot ?token= on Windows relay :3081)
Latest verifiedSee dsh-wsl-kit Compatibility (currently 0.1.5-rc.1) — single source of truth for the suite
Kit setdaily (also in github / full; fetch+net also in llm)
Cloud FlashUse model id deepseek-flash (V4.1 Flash) in ~/.dsh/settings.yaml / llm-deepseek — not configured by this plugin
Agent TeamsUpstream 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
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.

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