Update RTC configuration to use TURN only and replace STUN server URLs with a specific TURN server address.

This commit is contained in:
Xin Wang
2026-07-21 20:34:02 +08:00
parent 07b0927828
commit 65f45647a6

View File

@@ -14,9 +14,10 @@
const $self = {
rtcConfig: {
iceTransportPolicy: 'relay', // TURN only
iceServers: [
{ urls: 'stun:stun.l.google.com:19302' },
{ urls: 'stun:stun1.l.google.com:19302' },
// { urls: 'stun:stun.l.google.com:19302' },
// { urls: 'stun:stun1.l.google.com:19302' },
],
},
mediaConstraints: { audio: true, video: true },
@@ -630,7 +631,7 @@ function handleScConnectedPeers({ peers, credentials }) {
console.log(`Connected peer IDs: ${ids.join(', ')}`);
console.log(`TURN Credentials: ${JSON.stringify(credentials)}`);
// addCredentialedTurnServer('turn:coturn.example.com:3478', credentials);
addCredentialedTurnServer('turn:182.92.86.220:3478', credentials);
for (let id of ids) {
if (id === $self.id) continue;