Skip to content

v0.1.1 — Runtime-switchable outbound proxy

Choose a tag to compare

@tr1v3r tr1v3r released this 07 Sep 15:51
· 21 commits to master since this release

What you get

Route every in-process outbound request — LLM providers, web_search / web_fetch, streamable-http MCP — through an HTTP(S) CONNECT or SOCKS5 proxy, and flip it on / off / to another server at runtime by editing one settings section. Zero restarts.

# ~/.config/dsh/settings.yaml  (hot-reloaded)
dsh-proxy:
  enabled: true
  proxy: socks5://127.0.0.1:1080     # http(s):// also supported
  noProxy: [localhost, .internal.example]
  exportEnv: true                    # children (curl/git/MCP) follow too

Highlights

  • Real hot switching: dsh-proxy: settings section drives undici's global dispatcher; every save reroutes instantly (see the demo below)
  • HTTP(S) CONNECT via EnvHttpProxyAgent; SOCKS5 (with URL credentials) via undici's native agent; socks5h:///socks:// accepted
  • One noProxy matcher for both protocols (undici semantics: bare entries match host + dot-boundary subdomains, host:port pins a port, * bypasses all); ambient NO_PROXY/HTTP_PROXY env is deliberately ignored in-process
  • exportEnv mirrors the switch into child-process env without ever clobbering operator-set values; mid-session operator edits are adopted and restored
  • Invalid config keeps traffic direct and logs why — the host never crashes on a typo
  • Proxy URL credentials are redacted in logs

Install

# in ~/.config/dsh/profiles/<name>/package.json
"dependencies": { "@tr1v3r/dsh-proxy": "^0.1.1" },
"dsh": { "profile": { "bundles": ["@deepseek-ai/dsh-base", "@tr1v3r/dsh-proxy"] } }

dsh plugin --profile <name> install --no-frozen-lockfile

Restart once to mount; afterwards switching needs no restart.