- Startseite
- Plugins
- Tools & Funktionen
- dsh-net-hub
dsh-net-hub
yangdw2024/dsh-net-hub
Cross-platform network diagnostics and local port sharing in the sidebar and via the net_hub tool: multi-DNS and direct-vs-proxy X-Ray, listening port radar, built-in Bearer-token L7 reverse proxy with offline SVG QR, Cloudflare Quick Tunnel, Caddy v2 config/reload, SSH tunnel snippets, AI endpoint TTFT benchmarking, Git/npm/pnpm/pip proxy sync, and auto-discovered Mihomo/Clash and Tailscale controls. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Installation
dsh plugin --profile web add github:yangdw2024/dsh-net-hubREADME
dsh-net-hub
Cross-platform Network X-Ray, Multi-Line Local Port Sharer, AI Endpoint TTFT Lab & Live Proxy Cockpit for DeepSeek Harness (DSH).
English | 简体中文
Why dsh-net-hub?
Every DSH user runs into host-level network friction:
- "Why does GitHub / PyPI / my university HPC portal fail with
ERR_CONNECTION_CLOSEDunder TUN?" - "The browser works, why do
git clone,npm install, andpip installtime out in the terminal?" - "How do I share my local
127.0.0.1AI gateway / Ollama / Vite server with my phone, dorm PC, or home PC safely?" - "Which OpenAI/Anthropic endpoint has the lowest TTFT and fastest tok/s right now?"
dsh-net-hub works out of the box with zero external dependencies and zero hardcoded paths. On top of 4 universal core tools, it automatically discovers ecosystem tools installed on your machine (Clash Verge / Mihomo, Tailscale, Caddy v2, cloudflared, v2rayN, LoomGate, Antigravity Tools, CC Switch) and dynamically unlocks live controls — hiding whatever you don't have installed.
Features
1. Universal Core (Works on any Windows / macOS / Linux PC, 0 dependencies)
- URL / API Connectivity X-Ray: Parallel multi-DNS comparison (auto-detects Split-Horizon campus/corporate DNS & Fake-IP
198.18.x), Direct vs Local Proxy race (real HTTPSCONNECT + TLSv1.3handshake), TLS certificate check, and actionable recommendations. - Dev Tool Proxy Alignment: Inspect and one-click sync/clear proxy settings across Git, npm, pnpm, pip (
pip.ini/pip.conf), plus ready-to-copy PowerShell / Bash / Zsh / Fish env snippets. - Cross-Platform Port Radar + Multi-Line Port Sharing:
- Scans active listening ports with process names and bind scope (
LoopbackvsLAN) on Windows, macOS (lsof), and Linux (ss). - Line 1 (Built-in L7 Reverse Proxy — 0 dependencies): Expose any
127.0.0.1port to LAN/Tailscale with zero-buffer SSE streaming, immediate upstream abort on client disconnect, optional generated Bearer token (nh_...), live request log, and offline SVG QR code modal. - Line 2 (Cloudflare Quick Tunnel): Auto-discovers
cloudflaredand fronts local ports with the token-protected Built-in Proxy before publishing an instanthttps://*.trycloudflare.comURL. - Line 3 (Caddy v2 Studio): Generates multi-route
Caddyfile(flush_interval -1), runscaddy validate, and supports zero-downtimecaddy reloadover:2019. - Line 4 (SSH Reverse Tunnel): One-click
ssh -N -RandProxyJumpsnippet generation.
- Scans active listening ports with process names and bind scope (
- AI Endpoint Lab & Streaming TTFT Benchmark: Auto-discovers local Ollama (
:11434), LM Studio (:1234), vLLM (:8000), LoomGate (:8787), and Antigravity (:8045), probes/v1/models, runs explicit lightweight streaming benchmarks (max_tokens=32) measuring TTFT (ms) & throughput (tok/s), and copies configs for OpenAI / Claude Code / Codex / Gemini CLI / cURL.
2. Auto-Discovered Ecosystem Controls (Hidden when not installed)
- Mihomo / Clash Verge Live Cockpit: Connects directly to Windows Named Pipe (
\\.\pipe\verge-mihomo-*), macOS/Linux Unix Socket (/tmp/verge/verge-mihomo.sock), or HTTP controller (:9097/:9090) for live upload/download speed, 1-clickRule / Global / Directswitching, node selector + ping test, and active connection tracker with 1-click Add DIRECT & Kill. - Tailscale Mesh & Gateways: Live Tailnet coordinates, peer status, SSH
ProxyJumpgenerator, Antigravityallow_lan_accesstoggle, v2rayN core inventory, and CC Switch overview.
3. One Operation, Two Callers (UI + Agent Tool)
Every capability in the sidebar Net hub panel is exposed to DSH agents via the unified net_hub tool so your AI assistant can self-diagnose network errors, probe endpoints, sync Git/npm proxies, or spin up a temporary share proxy on demand.
Installation
Via DSH Plugin Manager (Recommended)
Open Settings → Plugins in DeepSeek Harness and install dsh-net-hub, or run:
dsh plugin add dsh-net-hub
From Local Directory
git clone https://github.com/yangdw2024/dsh-net-hub.git
# In DSH: Plugins -> Add plugin -> select the cloned directory
Security & Privacy Boundaries
- Secret Redaction (
src/redact.js): All config reads use explicit allowlists plus recursive redaction (api_key,token,secret,password, subscription URLs, inlinesk-*/Bearerstrings). Ephemeral keys entered in AI Lab are never persisted to disk. - Loopback-Only Host Fence: All
/api/dsh-net-hub/*HTTP routes verify loopback socket + loopbackHostheader + rejectX-Forwarded-For/CF-Connecting-IP(403 Forbidden), while honoring DSH's own paired-device session when present. - Backup-Before-Write: Every file mutation (
Merge.yaml,config.yaml,gui_config.json,pip.ini,settings.json) creates a timestamped.bakbackup and writes atomically. - Clean Teardown: Unloading or disabling the plugin stops all managed built-in share servers,
cloudflaredtunnels, and Caddy processes.
Repository Map (For Humans & AI Agents)
Start here instead of scanning the entire tree:
| Path | Responsibility |
|---|---|
index.js | Host Cordis entry, mountOnce guard, Loopback-fenced /api/dsh-net-hub/* routes, and net_hub agent tool schema/dispatch. |
client.js | Zero-build browser UI (sidebar.panellist + main panel), 5 tabs, Settings modal, and offline SVG QR encoder. |
src/service.js | NetHubService orchestrator — single source of truth shared by HTTP routes and the net_hub tool. |
src/platform.js | Cross-platform OS abstraction (Windows PowerShell, macOS lsof/scutil, Linux ss/resolv.conf, executable discovery). |
src/settings.js | Persistent user settings store at ~/.dsh/net-hub/settings.json with universal zero-hardcode defaults. |
src/redact.js | Recursive secret key/value scrubber. |
src/utils.js | TCP/HTTP/Proxy probes, atomic file writer with .bak, Loopback request fence. |
src/lines/ | Multi-line sharing layer: index.js (LineRegistry), cloudflared.js, ssh-tunnel.js (+ adapters/builtin-proxy.js, adapters/caddy.js). See docs/LINE_INTEGRATION.md. |
src/adapters/xray.js | Multi-DNS + Direct vs Proxy HTTPS race + TLS certificate inspector. |
src/adapters/port-radar.js | Cross-platform listening socket radar & service classifier. |
src/adapters/ai-lab.js | Local AI discovery, /v1/models probe, streaming SSE TTFT & tok/s benchmark. |
src/adapters/dev-proxy-sync.js | Git / npm / pnpm / pip proxy sync & clear + shell env snippets. |
src/adapters/mihomo-live.js | Live Mihomo/Clash controller over Windows Named Pipe / Unix Socket / HTTP. |
src/adapters/clash-verge.js | Safe Merge.yaml (preserving existing rules, never overwriting fake-ip-filter) & TUN exclusion updater. |
src/adapters/tailscale.js | Cross-platform tailscale status --json parser (filters funnel-ingress-node). |
tests/net-hub.test.js | node --test unit & live integration test suite. |
Where to Look When Debugging
- Mihomo tab does not appear: Check
src/adapters/mihomo-live.js_discover()(Named Pipe on Windows, Unix Socket on macOS/Linux, HTTP:9097/:9090fallback). - Port Radar shows wrong process or empty list: Check OS parser in
src/platform.js(listRawListeningSockets,parseLsofListenOutput,parseSsListenOutput). - Share proxy returns 401 or 502: Check
src/adapters/builtin-proxy.jstoken header stripping andclientRes.on('close')abort hook. - Caddy validation or start fails: Check
src/adapters/caddy.jssanitizeListenAddr(bare IPs needhttp://prefix in Caddy v2) and:2019Originheader.
Development & Testing
npm test
License
MIT © yangdw2024
Ähnliche Plugins
archify (deepseek-harness)
tt-a1i/archify
WeKnora (dsh-weknora)
tencent/weknora
next-ai-draw-io (dsh-plugin)
dayuanjiang/next-ai-draw-io
AiToEarn (dsh-plugin-aitoearn)
yikart/aitoearn