Skip to main content
A

dsh-vpn-proxy

aeolusjack/dsh-vpn-proxy

Routes DeepSeek Harness network traffic through your VPN's local HTTP proxy when it is running and falls back to a direct connection otherwise, with automatic detection and periodic re-checking on Windows and macOS.

Install

dsh plugin --profile web add github:aeolusjack/dsh-vpn-proxy

README

dsh-vpn-proxy

A DeepSeek Harness plugin that routes all Harness network traffic through your VPN's local HTTP proxy while it is running, and falls back to a direct connection when it is not.

When you use a proxy-based VPN client (Clash, Mihomo, sing-box, v2rayN, Privoxy, …) you normally have to remember to export HTTP_PROXY before launching the Harness — and restart it whenever you toggle the VPN. This plugin does it automatically, on both Windows and macOS, without a restart.

What it does

  • Detects the VPN. Probes a list of well-known local HTTP proxy ports (7890, 7891, 7897, 10809, 8889, 2080, 8118, …) and reads the OS system proxy (Windows Internet Settings, macOS scutil --proxy).
  • Verifies before switching. A candidate is only accepted after a real CONNECT + TLS handshake succeeds against a test URL, so a dead proxy or an unrelated service on that port is never installed.
  • Routes everything through one policy. It installs the detected proxy through @deepseek-ai/dsh-http-proxy, which swaps undici's global dispatcher and publishes the environment. That single install covers the LLM adapters, web search/fetch, MCP-over-HTTP, telemetry, and every spawned child (git, npm, curl, subagents).
  • Falls back to direct. When no proxy verifies, traffic connects directly.
  • Re-checks on an interval. Toggling the VPN on or off is picked up automatically. Routing only changes when the answer actually changes.
  • Keeps the Web UI local. Loopback traffic (127.0.0.1, localhost, ::1) is always bypassed, so the Harness never tunnels its own UI through the proxy.

Install

In DeepSeek Harness open Plugins → Add plugin and enter the repository URL:

https://github.com/AeolusJack/dsh-vpn-proxy

From a local directory

git clone https://github.com/AeolusJack/dsh-vpn-proxy

Then in Plugins → Add plugin, choose the cloned directory.

Configuration

The plugin works with sensible defaults. Open the plugin's row in Settings to tune it. Available fields:

FieldDefaultMeaning
enabledtrueTurn automatic routing on or off.
modeautoauto (detect), proxy (always use proxyUrl), direct (always direct), off (do nothing).
proxyUrl""Explicit proxy URL for proxy mode, also tried first in auto.
candidatescommon portsLocal http:// proxy URLs probed in auto mode.
testUrlhttps://www.gstatic.com/generate_204HTTPS URL used to verify a proxy tunnels traffic.
intervalMs30000How often to re-check for a VPN.
timeoutMs4000Per-probe timeout.
useSystemProxytrueAlso read the OS system proxy.
respectEnvtrueAlso consider HTTP_PROXY/HTTPS_PROXY/ALL_PROXY inherited at launch.
noProxy""Comma-separated hosts that always connect directly (loopback is always added).

Supported VPN clients

Any client that exposes a local HTTP proxy works out of the box:

  • Clash / Mihomo / Clash Verge — mixed port 7890 (or 7891/7897).
  • v2rayN / V2Ray — HTTP port 10809 (or 1081).
  • sing-box — mixed port 2080.
  • Privoxy — 8118.
  • Anything else — add its http://127.0.0.1:<port> to candidates, or enable system proxy in the client.

Limitations

  • HTTP/HTTPS proxies only. SOCKS5-only endpoints (e.g. a bare ss-local on 1080) are not supported, because the underlying Harness transport only accepts http:// and https:// proxies. Most modern clients expose a mixed/HTTP port that works.
  • TUN / system-VPN mode. A VPN that only creates a virtual network interface and does not expose an HTTP proxy port cannot be detected by port probing. If the client also sets the system proxy, it is still detected via useSystemProxy; otherwise configure its HTTP proxy URL explicitly in proxyUrl.
  • Switching the proxy mid-request can interrupt a long-lived streaming request that was already in flight, but only when the VPN state actually changes.

Requirements

  • DeepSeek Harness 0.2.2-rc.5 or a compatible release (the plugin pins engines.dsh).
  • Node.js >= 24.9.0 (bundled with the Harness).
  • Windows, macOS, or Linux.

License

MIT

Related plugins