xchannel1987/dsh-reverse-proxy-xc

xchannel1987/dsh-reverse-proxy-xc

DSH 局域网反向代理插件 - 让手机/平板访问 DSH 获得完整功能,修复反代访问时设置面板无法打开的问题。

远程与移动端

dsh-reverse-proxy-xc

中文 | English

DSH LAN Reverse Proxy Plugin — Seamless access to DSH Web GUI from mobile/tablet devices on your local network with the full desktop experience.

DSH 0.1.7 compatible (>=0.1.7-rc.1): adapted to the 0.1.7 breaking changes (ctx.settings.register removed, client service settingsScope → configForms). Settings stay under Settings → LAN Reverse Proxy; saving hot-restarts the proxy via the /api/dsh-reverse-proxy-xc/control route.

✨ Core Features

🌐 Full Feature Access

  • Sidebar Available: Workspaces and session list display normally
  • Settings Panel: All settings accessible
  • Credential Management: API credentials can be managed
  • WebSocket Support: Real-time event push works properly

🔧 Issue Fixes

This plugin resolves critical issues when accessing via reverse proxy:

IssueCauseSolution
Settings panel won't openFrontend disables on non-loopbackProxy injects isLoopback=true
randomUUID errorAPI unavailable under HTTPAuto-inject polyfill
WebSocket disconnectsProxy not forwarding correctlyStream passthrough support
authentication required promptMobile access lacks launch tokenAuto-acquire and inject valid session cookie (bypassToken)

🚀 Technical Implementation

  • Standalone Server: Listens on 0.0.0.0:3090 by default
  • Request Forwarding: Forwards to DSH main service at 127.0.0.1:3080
  • Header Rewriting: Rewrites Host/Origin to loopback address
  • HTML Injection: Auto-injects necessary polyfills

🔒 Security Design

  • LAN Only: Designed for trusted internal network use
  • Trust Barrier: Preserves DSH's original security mechanisms
  • Configurable: Disabled by default, requires manual activation

📦 Installation

# Using DSH CLI
dsh plugin --profile web add dsh-reverse-proxy-xc

# Or using npm
npm install dsh-reverse-proxy-xc

Restart DSH after installation.

⚙️ Configuration

  1. Open DSH Settings
  2. Find "LAN Reverse Proxy" section
  3. Enable "Enable Proxy" toggle
  4. Configure port (default: 3090)

Configuration Options

OptionDefaultDescription
enabledfalseWhether to enable proxy
port3090Listen port
host0.0.0.0Listen address
bypassTokentrueBypass Token Auth (auto-inject valid session cookie, no launch token required)
authEnabledfalseWhether to enable Basic access authentication
authUseradminAuth username
authPass123456Auth password

🎮 Usage

  1. Ensure target device and host are on the same LAN or VPN
  2. Access from target device browser:
http://<host-lan-ip>:3090

Example: http://10.100.50.125:3090

  1. Enjoy the same experience as local http://127.0.0.1:3080

🔧 How It Works

Mobile Browser
    ↓ HTTP/WS
Reverse Proxy (0.0.0.0:3090)
    ↓ Rewrite Headers
DSH Main Service (127.0.0.1:3080)
    ↓ Treats as loopback access
Full features unlocked

⚠️ Security Notes

  • Don't Expose to Internet: This plugin is designed for trusted internal networks
  • VPN Recommended: Use VPN for cross-network access
  • Sensitive Operations: Involves credentials and settings, ensure network security

📄 License

MIT