DSH Plugin Mobile Gateway: iPhone Connects to DSH via Device-Authenticated WebSocket

Preface

The DSH plugin ecosystem follows the “everything is a plugin” philosophy. For those already using DSH who want to continue accessing the same DeepSeek Harness on their iPhone, a WebSocket endpoint that iOS clients can connect to, with device authentication, is necessary.

dsh-plugin-mobile-gateway addresses this scenario: it installs under the DSH Web plugin profile and provides a “Mobile Devices” entry in the DSH WebUI for enabling the gateway, generating pairing QR codes, and managing trusted devices.

What This Is

dsh-plugin-mobile-gateway is maintained by Clarklevis1995 and is licensed under MIT. It allows iPhones to connect to DeepSeek Harness via a WebSocket connection with device authentication.

The WebSocket path used by the plugin is:

/ws/mobile

The current package.json version is 0.6.5. One-click public network installation on Linux servers has been available since v0.6.4.

Core Capabilities

Here are the verified main features:

  • Provides a “Mobile Devices” entry in the DSH WebUI left sidebar
  • Can enable the gateway, generate pairing QR codes, and manage trusted devices
  • Supports LAN WebSocket connections: ws://<LAN IP>:3081/ws/mobile
  • Supports public network WebSocket connections on Linux servers: wss://<public IP>/ws/mobile
  • iOS device pairing via QR codes
  • Supports remote connection to port 3081 via Tailscale Serve or Cloudflare Quick Tunnel
  • For Linux server public network scenarios, can install system Helper, Nginx, Certbot, and certificate renewal timers
  • Provides management commands such as status, remove, and remove-helper for public network entry/Helper management

Installation and Enablement

Before installation, ensure the dsh CLI and pnpm are installed and that dsh web starts normally.

Install the plugin with the following command:

dsh plugin --profile web add dsh-plugin-mobile-gateway@latest

After installation, stop and restart the WebUI:

dsh web

After startup, open the WebUI and confirm that “Mobile Devices” appears in the left sidebar.

LAN Pairing

If your iPhone is on the same LAN as the computer running DSH, follow these steps to pair.

  1. Open “Mobile Devices” in the WebUI.

  2. Enable “Allow Mobile Device Connections.”

  3. Keep “Device Authentication” enabled.

  4. Enter a device name and click “Generate Pairing QR Code.”

  5. In the iOS client, open “Device Authentication” and scan the QR code.

  6. Wait for the trusted device in the WebUI to show “Online.”

The LAN connection address is:

ws://<LAN IP>:3081/ws/mobile

Note:

  • Pairing QR codes can only be used once and expire after 5 minutes.
  • If the system firewall blocks the connection, only allow private network access to TCP 3081.
  • Do not expose TCP 3081 to the public network, and do not expose the DSH WebUI port either.

Linux Server Public Network Access

Public network pairing on Linux servers is suitable for Ubuntu/Debian servers with a fixed public IPv4 address. CentOS is currently not supported.

First, run the initialization command:

npx --yes dsh-plugin-mobile-gateway@latest init

This command will request sudo privileges once to install the system Helper, Nginx, Certbot, and certificate renewal timers. After completion, start or restart:

dsh web

Go to “Mobile Devices” in the WebUI, enter the public IPv4 address under “Public Network Access,” and click “Configure Public Network Access” or “Update Public Network Configuration.”

The public WebSocket address is:

wss://<public IP>/ws/mobile

The pairing steps are the same as for LAN, but “Device Authentication” must remain enabled during public network debugging.

Using Tailscale or Cloudflare Quick Tunnel

If you don’t have a direct public IPv4 entry, you can use Tailscale Serve or Cloudflare Quick Tunnel to forward port 3081. Before using, start dsh web and enable “Allow Mobile Device Connections” and “Device Authentication” in the “Mobile Devices” panel.

For Tailscale Serve, run:

tailscale serve --bg 3081

Then change the generated address to:

wss://<device-name>.<tailnet>.ts.net/ws/mobile

Enter it in the WebUI, then generate a QR code for pairing.

For Cloudflare Quick Tunnel, run:

cloudflared tunnel --url http://127.0.0.1:3081

The command line will display something like:

https://<random-name>.trycloudflare.com

Change the address to:

wss://<random-name>.trycloudflare.com/ws/mobile

Enter it in the WebUI, then generate a QR code for pairing. Cloudflare Quick Tunnel is only for temporary debugging; the address may change each time and offers no availability guarantee.

Management and Uninstallation

Check the public network entry status:

sudo env "PATH=$PATH" npx --yes dsh-plugin-mobile-gateway@latest status

The plugin also provides two types of management commands, remove and remove-helper, used to remove the public network entry or the system Helper, respectively. Confirm the server’s current purpose before executing them.

Uninstall the plugin:

dsh plugin --profile web remove dsh-plugin-mobile-gateway

Source Development

For source development, install the plugin using a file: path and restart dsh web.

Applicable Scenarios and Notes

  • Suitable for scenarios where you need to access DSH on an iPhone via an iOS client.
  • Suitable for LAN, Linux servers with public IPv4, or remote connections via Tailscale / Cloudflare Quick Tunnel.
  • The plugin runs with the current dsh process permissions; review the source code and license before installation.
  • Do not expose the DSH WebUI port or TCP 3081 to the public network.
  • Device authentication must remain enabled during public network debugging.
  • Pairing QR codes can only be used once and expire after 5 minutes.
  • Linux server public network access is suitable for Ubuntu/Debian; CentOS is currently not supported.

Links

GitHub repository:

https://github.com/Clarklevis1995/dsh-plugin-mobile-gateway
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye