Loading...
const pc = new RTCPeerConnection({
iceServers: [{
urls: 'turn:turn.example.com:3478',
username: 'admin',
credential: 'secret123',
}],
});const res = await fetch('/api/turn-credentials');
const { iceServers } = await res.json();
const pc = new RTCPeerConnection({ iceServers });The backend issues short-lived TURN credentials per session, so nothing reusable is shipped in client code.
The backend builds a username with an expiry time and signs it with an HMAC using a secret shared with the TURN server, which checks both.
No. It relays packets that WebRTC encrypts between the peers, so the relay cannot decrypt the audio or video.
Usually a minority, mostly on corporate or mobile networks with strict NAT. Without TURN those calls simply fail.