Signaling server for BitBang. Handles WebSocket signaling between devices and browsers to establish WebRTC connections.
Requires Python 3.10+ with a virtual environment:
python3 -m venv venv
venv/bin/pip install quart hypercorn cryptographyThe server generates ephemeral TURN credentials using the TURN REST API (coturn shared secret). Create a .env file in signaling/:
COTURN_HOST=turn.example.com
COTURN_SECRET=your-shared-secret
The COTURN_SECRET must match the static-auth-secret in your coturn server's turnserver.conf.
Optional: COTURN_TTL=86400 (credential lifetime in seconds, default 24h).
Without TURN configured, connections only work when peers can reach each other directly.
cd signaling
./run.shListens on port 8081. Use a reverse proxy (nginx/caddy) for TLS.
The upload script tars the signaling/ directory, uploads it to the server via SCP, extracts it, and restarts the signaling.service systemd unit.