From 0baae026938649e020a0c26a78ec152a0f012d19 Mon Sep 17 00:00:00 2001 From: Nulo Date: Sun, 5 Mar 2023 23:54:08 +0000 Subject: [PATCH] usar turn --- src/lib/doc.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/lib/doc.ts b/src/lib/doc.ts index 3d5b844..c17550c 100644 --- a/src/lib/doc.ts +++ b/src/lib/doc.ts @@ -34,6 +34,32 @@ export function getWorldY(world: WorldIdentifier): WorldY { "wss://y-webrtc-signaling-eu.herokuapp.com", "wss://y-webrtc-signaling-us.herokuapp.com", ], + peerOpts: { + config: { + iceServers: [ + { urls: "stun:stun.l.google.com:19302" }, + { urls: "stun:global.stun.twilio.com:3478?transport=udp" }, + { + urls: "stun:relay.metered.ca:80", + }, + { + urls: "turn:relay.metered.ca:80", + username: "7aec233ea46fa835147308ae", + credential: "c0eTB5pqj9vOxhii", + }, + { + urls: "turn:relay.metered.ca:443", + username: "7aec233ea46fa835147308ae", + credential: "c0eTB5pqj9vOxhii", + }, + { + urls: "turn:relay.metered.ca:443?transport=tcp", + username: "7aec233ea46fa835147308ae", + credential: "c0eTB5pqj9vOxhii", + }, + ], + }, + }, }); const idbProvider = new IndexeddbPersistence(world.room, ydoc); const worldY = { ydoc, webrtcProvider: provider };