|
|
5 dagar sedan | |
|---|---|---|
| .. | ||
| README.md | 5 dagar sedan | |
| docker-compose.yml | 5 dagar sedan | |
| turnserver.conf | 5 dagar sedan | |
Why: customers behind symmetric NAT / corporate firewalls / VPNs can’t form a direct WebRTC path, so screen share blanks out and disconnects. A TURN relay fixes it. We host our own coturn on a VM we already own — flat cost, no per-GB billing.
turn.yourdomain.com -> that public IP.certbot certonly --standalone -d turn.yourdomain.com3478/udp and 3478/tcp (STUN/TURN)5349/tcp (TURN over TLS) — and 443/tcp if you enable alt-tls49152-65535/udp (relay range)Edit turnserver.conf:
external-ip= your VM’s public IPstatic-auth-secret= a long random string (e.g. openssl rand -hex 32)realm= your domaincert= / pkey= paths to your Let’s Encrypt certdocker compose up -d # uses docker-compose.yml here
# or native: apt install coturn; copy this file to /etc/turnserver.conf; enable in /etc/default/coturn; systemctl enable --now coturn
TURN_URLS=turn:turn.yourdomain.com:3478,turn:turn.yourdomain.com:3478?transport=tcp,turns:turn.yourdomain.com:5349?transport=tcp
TURN_SECRET=<the same static-auth-secret from turnserver.conf>
TURN_TTL=86400
The app’s /api/ice mints short-lived credentials from TURN_SECRET automatically — no
permanent password is exposed, and outsiders can’t reuse your relay. Restart the app.
GET https://<app>/api/ice should return a turn:/turns: entry with a username + credential.turns:turn.yourdomain.com:5349?transport=tcp with the username/credential from
/api/ice; you should see a candidate of type relay. If you do, restrictive networks
are covered.