Configure self-hosted STUN for remote WebRTC

This commit is contained in:
Xin Wang
2026-08-05 14:05:22 +08:00
parent 16156028c9
commit 0456d2b4ae
7 changed files with 53 additions and 36 deletions

View File

@@ -38,9 +38,13 @@ AUTH_TOKEN_EXPIRE_MINUTES = int(os.getenv("AUTH_TOKEN_EXPIRE_MINUTES", "1440"))
AUTH_COOKIE_SECURE = os.getenv("AUTH_COOKIE_SECURE", "false").lower() == "true"
AUTH_COOKIE_SAMESITE = os.getenv("AUTH_COOKIE_SAMESITE", "lax")
# ---- WebRTC TURN ----
# ---- WebRTC STUN / TURN ----
# Override STUN_URL in remote deployments to use the colocated coturn server
# instead of waiting for a public STUN service that may be unreachable.
STUN_URL = os.getenv("STUN_URL", "stun:stun.l.google.com:19302")
# TURN_URLS example:
# turn:182.92.86.220:3478?transport=udp,turn:182.92.86.220:3478?transport=tcp
# turn:118.89.89.89:3478?transport=udp,turn:118.89.89.89:3478?transport=tcp
TURN_URLS = _split(os.getenv("TURN_URLS", ""))
TURN_SECRET = os.getenv("TURN_SECRET", "")
TURN_USERNAME = os.getenv("TURN_USERNAME", "")