There is no guard code for when a client disconnects and then another client issues a peer connection request. The system will try and pull the client id from the client array but will get a null in that case which will crash the process when emit() is called on the null.
I'd submit a PR if your open to accepting it. But I'm not sure yet how to signal the error back to the client trying to make the connection request.
https://github.com/tomcartwrightuk/socket.io-p2p-server/blob/master/index.js#L42
There is no guard code for when a client disconnects and then another client issues a peer connection request. The system will try and pull the client id from the client array but will get a null in that case which will crash the process when emit() is called on the null.
I'd submit a PR if your open to accepting it. But I'm not sure yet how to signal the error back to the client trying to make the connection request.
https://github.com/tomcartwrightuk/socket.io-p2p-server/blob/master/index.js#L42