Network Connectivity Requirements
For the Telnyx WebRTC JS SDK to function properly, the client must be able to reach Telnyx’s signaling and media infrastructure.Overview
The SDK requires connectivity to three types of endpoints:Signaling
The SDK uses a persistent WebSocket connection for call signaling (invite, answer, hangup, etc.).
Requirements:
- Outbound WebSocket connections must be allowed on port 443
- No HTTP long-polling fallback — WebSocket is required
- Connection must remain open for the duration of the session
env property, but this is not recommended for production.
STUN
STUN servers help the client discover its public IP address for ICE negotiation.
The SDK automatically uses these STUN servers. No configuration required.
TURN
TURN servers relay media when direct peer-to-peer connectivity is not possible (e.g., symmetric NAT, restrictive firewalls).
The SDK automatically provisions TURN credentials. No manual configuration required.
UDP vs TCP vs TURNS/443:
- UDP (preferred) — Lower latency, better for real-time audio
- TCP (fallback) — Higher latency, used when UDP is blocked
- TURNS over 443 (last resort) — TURN over TLS on port 443, used when both UDP and TCP/3478 are blocked by restrictive firewalls or proxies
TURN credentials are automatically provisioned by the SDK. You do not need to configure TURN usernames or passwords.
Starting with SDK v2.27.4, the default ICE server list includes a TURNS (TURN over TLS) entry on port 443 (
turns:turn2.telnyx.com:443) in addition to the existing TURN UDP/3478 and TCP/3478 entries. This provides a last-resort relay fallback for networks that block both UDP/3478 and TCP/3478 but allow outbound TCP/443.Firewall Configuration
Minimum required rules
Optional but recommended
Media ports
RTP media uses dynamic ports allocated by the browser. These are ephemeral and cannot be whitelisted by port number. Instead:- Ensure TURN is accessible — TURN handles media relay when direct connectivity fails
- Allow UDP outbound to Telnyx media servers (the
remote_media_ipseen in SDP) - Don’t restrict outbound UDP to specific ports — this will break WebRTC
Restrictive Network Scenarios
STUN fails (error 701)
Symptom: Client cannot discover its public IP. Nosrflx or prflx ICE candidates.
Fix:
- Check firewall allows UDP to
stun.telnyx.com:3478 - If STUN is blocked, TURN may still work — the SDK falls back automatically
- If both STUN and TURN are blocked, calls cannot connect
TURN fails
Symptom: Client is on a restrictive network (symmetric NAT), can’t getrelay candidates.
Fix:
- Check firewall allows UDP to
turn.telnyx.com:3478 - If UDP is blocked, check firewall allows TCP to
turn.telnyx.com:3478 - If both UDP/3478 and TCP/3478 are blocked, TURNS over TLS on port 443 to
turn2.telnyx.comwill work — this is included in the default ICE server list since SDK v2.27.4 - If all TURN paths are blocked, use
forceRelayCandidate: trueto skip direct connectivity attempts:
Custom ICE servers with TELNYX_ICE_SERVERS
Starting with SDK v2.27.4, the SDK exports a public TELNYX_ICE_SERVERS catalog of ready-to-use ICE server entries. Import it and compose any combination into the iceServers option to override the defaults:
When you omit
iceServers, the SDK uses its built-in defaults (DEFAULT_PROD_ICE_SERVERS) which include STUN + TURN UDP/3478 + TURN TCP/3478 + TURNS/443. Providing an explicit iceServers array replaces the defaults entirely.Corporate VPN
Symptom: Calls fail or have poor quality through VPN. Fix:- Whitelist
rtc.telnyx.com,stun.telnyx.com,turn.telnyx.com, andturn2.telnyx.comin VPN split-tunneling config - Ensure VPN doesn’t block UDP traffic to TURN servers or TLS to
turn2.telnyx.com:443 - Consider split-tunneling so WebRTC traffic bypasses the VPN
Docker / Container environments
Symptom: STUN errors, no ICE candidates, one-way audio. Fix:- Docker’s default bridge network (
172.xor10.x) can interfere with ICE candidate gathering - Use
--network hostmode for the container - Or configure the Docker network to use the host’s network stack
Testing Connectivity
Quick test
Open your browser’s DevTools console and run:Debug tools
- SDK debug mode: Set
debug: trueanddebugOutput: 'socket'in IClientOptions - Debug visualizer: Upload debug data to
https://webrtc-debug.telnyx.com/ - Call reports: Enable
enableCallReports: truefor programmatic access to ICE stats
Bandwidth Requirements
Recommended minimum bandwidth per call:
- Audio only: 100 kbps (including overhead)
- With video: 500-2000 kbps depending on resolution
See Also
- IClientOptions — ICE and network configuration
- Debug Data & Call Quality Analysis — Interpreting ICE and quality data
- Best Practices — Production deployment guide
- Error Handling — ICE and WebSocket error codes