Skip to content

Latest commit

 

History

History
63 lines (43 loc) · 1.45 KB

File metadata and controls

63 lines (43 loc) · 1.45 KB

@spawn-dock/dev-tunnel

WebSocket tunnel client for SpawnDock local development preview. Exposes your local dev server through the SpawnDock control plane so others can preview your Telegram Mini App.

Install

npm install -g @spawn-dock/dev-tunnel

Or use with npx:

npx @spawn-dock/dev-tunnel

Usage

With spawndock.dev-tunnel.json (recommended)

If your project has a spawndock.dev-tunnel.json file (created by the bootstrap CLI), just run:

npx @spawn-dock/dev-tunnel

With CLI arguments

npx @spawn-dock/dev-tunnel \
  --control-plane http://your-server:3000 \
  --project-slug my-app \
  --device-secret your-device-secret \
  --port 3000

With environment variables

export SPAWNDOCK_CONTROL_PLANE=http://your-server:3000
export SPAWNDOCK_PROJECT_SLUG=my-app
export API_TOKEN=your-shared-api-token
export SPAWNDOCK_PORT=3000
npx @spawn-dock/dev-tunnel

API_TOKEN is the preferred auth mode for standalone package usage. SPAWNDOCK_DEVICE_SECRET remains supported for bootstrap-generated project credentials.

Configuration Priority

CLI arguments > Environment variables > spawndock.dev-tunnel.json > legacy spawndock.config.json

How it works

  1. Connects to the SpawnDock control plane via WebSocket
  2. Receives HTTP requests from users viewing your preview URL
  3. Proxies those requests to your local dev server
  4. Sends responses back through the tunnel

License

MIT