Architecture Overview
| Component | Port | Role |
|---|---|---|
| Control Plane | 3001 | Session creation, slug allocation, lifecycle management |
| Gateway | 3002 | TLS termination, routing, stream forwarding |
| CLI | — | Connects to gateway, forwards traffic to localhost |
Prerequisites
- Node.js 18+ and npm
- Go 1.20+
- Git
Installation
Install dependencies
Use the Makefile to install all dependencies at once:Or install each component manually:
Configure environment variables
Copy the example environment file:For local development, the defaults work out of the box:See Environment Variables for all configuration options.
Testing Your Setup
Development Workflow
Hot Reload
Both the control plane and gateway support hot reload:- Control Plane: Uses
npm run devwith auto-reload on file changes - Gateway: Restart with
go run .after making changes - CLI: Rebuild with
npm run buildafter changes
Running Tests
Building for Production
- CLI:
packages/cli/dist/ - Control Plane:
packages/control-plane/dist/ - Gateway: Binary compilation via
go build
CLI Usage
Once installed, the CLI provides these commands:In v0, some commands are not yet implemented:
wormkey login- Authentication (not implemented)wormkey status- View active tunnels (not implemented)wormkey close- Use Ctrl+C to close tunnels
Troubleshooting
Control Plane won’t start
- Check port 3001 is not in use:
lsof -i :3001 - Verify Node.js version:
node --version(requires 18+) - Check logs for specific errors
Gateway won’t start
- Check port 3002 is not in use:
lsof -i :3002 - Verify Go version:
go version(requires 1.20+) - Ensure dependencies are installed:
go mod download
CLI can’t connect
- Verify control plane is running on port 3001
- Verify gateway is running on port 3002
- Check environment variables in
.env - Ensure WebSocket connections are allowed (no proxy blocking)
Tunnel disconnects immediately
- Check that your local server is actually running on the specified port
- Verify firewall isn’t blocking localhost connections
- Check gateway logs for connection errors