From: Ruben Beltran del Rio Date: Mon, 28 Aug 2023 20:12:37 +0000 (+0200) Subject: Convert to array X-Git-Url: https://git.r.bdr.sh/rbdr/junction/commitdiff_plain/ff9e30b6132098d29739103abb415cc7410166fc?ds=sidebyside;hp=139f43c6caf963d66704fe1675bcc70735e21926 Convert to array --- diff --git a/server/index.js b/server/index.js index 37104e1..66f47ae 100644 --- a/server/index.js +++ b/server/index.js @@ -15,7 +15,7 @@ server.on('connection', (socket) => { socket.on('join', (data) => { socket.join(data.url); - const sockets = server.of(data.url).sockets.keys(); + const sockets = [...server.of(data.url).sockets.keys()]; sockets.forEach((peerId) => { if (peerId !== me) { const peer = server.sockets.sockets.get(peerId) @@ -34,7 +34,7 @@ server.on('connection', (socket) => { }); socket.on('relayICECandidate', (data) => { - const sockets = server.of(data.url).sockets.keys(); + const sockets = [...server.of(data.url).sockets.keys()]; sockets.forEach((peerId) => { const peer = server.sockets.sockets.get(peerId) peer.emit(events.types.ICE_CANDIDATE_RECEIVED, events.ICECandidateReceived(me, data.ice_candidate)) @@ -44,7 +44,7 @@ server.on('connection', (socket) => { }); socket.on('relaySessionDescription', (data) => { - const sockets = server.of(data.url).sockets.keys(); + const sockets = [...server.of(data.url).sockets.keys()]; sockets.forEach((peerId) => { const peer = server.sockets.sockets.get(peerId) peer.emit(events.types.SESSION_DESCRIPTION_RECEIVED, events.SessionDescriptionReceived(me, data.session_description))