I am trying to do signaling in rooms. I looked to the "p2p-snake" example and the socket-io-p2p documentation for how to pass the P2P server the socket and the room, however both the my code and the p2p-snake example crash here at line 25 of socket.io-p2p-server's index.js:
The socket.on('offers') call back's foreach is able to get a undefined peer client when it goes for it in the clients array - client=clients[client.id].
In my code the connectedClients only contains one client - the one that equals the socket in if (client !== socket) as my p2p server currently starts signaling as soon as the client connects. In the p2p-snake code, it crashes immediately as well once one client is connected.
I am trying to do signaling in rooms. I looked to the "p2p-snake" example and the socket-io-p2p documentation for how to pass the P2P server the socket and the room, however both the my code and the p2p-snake example crash here at line 25 of socket.io-p2p-server's index.js: The
socket.on('offers')
call back's foreach is able to get a undefined peer client when it goes for it in the clients array -client=clients[client.id]
. In my code the connectedClients only contains one client - the one that equals thesocket
inif (client !== socket)
as my p2p server currently starts signaling as soon as the client connects. In the p2p-snake code, it crashes immediately as well once one client is connected.