Session Configuration
Wormkey sessions control how long your wormhole stays open and who can access it. Configure expiry, viewer limits, and access policies.Session Creation
Sessions are created when you runwormkey http <port>. The control plane returns:
Expiry Configuration
Control how long your wormhole stays active using the--expires flag.
Syntax
Duration Formats
- Minutes
- Hours
- Default
Examples
How Expiry Works
Session Policy
Sessions include a policy object that controls access and behavior:Default Policy
Update Policy
Use the control plane API to modify session policy:Viewer Management
Sessions track active viewers in real-time.Active Viewers
Update Viewers
The edge gateway periodically reports active viewers:Kick Viewer
Remove a specific viewer from the session:Close Session
Manually close a session before expiry:session.closed = true. The edge gateway rejects all future requests.
CLI Close
PressCtrl+C in the terminal running wormkey http to close the tunnel and session.
Authentication Modes
Sessions support multiple authentication strategies.None (Default)
Basic Auth
Environment Variables
Customize control plane and edge URLs:| Variable | Default | Description |
|---|---|---|
WORMKEY_CONTROL_PLANE_URL | https://wormkey-control-plane.onrender.com | Control plane API URL |
WORMKEY_EDGE_URL | wss://t.wormkey.run/tunnel | Edge tunnel WebSocket URL |
WORMKEY_PUBLIC_BASE_URL | https://wormkey.run | Public gateway base URL |
Local Development
Override for local testing:--local flag:
Session Lifecycle
Expire or Close
Session ends when:
expiresAttimestamp reached- Owner closes via API or
Ctrl+C - Control plane restarts (in-memory store)
Best Practices
Short-lived sessions
Use
--expires 30m or --expires 1h for temporary demos to minimize exposure.Combine auth + expiry
Monitor active viewers
Check the owner overlay to see who’s connected and kick unauthorized viewers.
API Reference
Create Session
Get Session by ID
Get Session by Slug
Delete Session
Related
- Basic Authentication - Enable username/password protection
- CLI Reference - Full
wormkey httpcommand options