Skip to content

Commit

Permalink
Allow configuration of iceservers
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron7 committed Jun 2, 2024
1 parent 19fd180 commit fd5f03d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils/collab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@ export const createWebrtcProvider = (session: Session, isHost: boolean) => {
const roomId = `${ROOM_ID_PREFIX}${session.roomId}`;

const ydoc = new Doc();
const signalingServerUrl = import.meta.env.VITE_SIGNALING_SERVER_URL;
const signalingServerUrl = import.meta.env.VITE_WEBRTC_SIGNALING_SERVER_URL;
const iceServersJson = import.meta.env.VITE_WEBRTC_ICE_SERVERS_JSON;
const webrtcProvider = new WebrtcProvider(roomId, ydoc, {
password: session.secret,
peerOpts: {
config: {
...(iceServersJson ? JSON.parse(iceServersJson) : {}),
},
},
signaling: [signalingServerUrl || 'ws://localhost:4444'],
});

Expand Down

0 comments on commit fd5f03d

Please sign in to comment.