peers / peerjs

Simple peer-to-peer with WebRTC.
https://peerjs.com
MIT License
12.48k stars 1.43k forks source link

Is there any API by which peerjs server can close any of it's connected client. #382

Closed vivekkumar27june88 closed 6 years ago

vivekkumar27june88 commented 7 years ago

I want to modify the peerjs server code so that if a connection event come for existing client id then I first close the existing client, clean up entries from _clients and _ips and then call the _configureWS for this new socket.

Question:

  1. Is there any API available in PeerJs server code or in ws npm package for closing the client socket.
  2. What are required steps for cleaning up the entries of client maintained by the peerjs server.
kidandcat commented 6 years ago

Why do you want to do that? You cannot know if the new connection comes from an existing client or not, if you do what you say, I can close A connection by connecting from B with same ID.

vivekkumar27june88 commented 6 years ago

Hi @kidandcat, Thanks for your response. You can close this issue.

I had posted this question long back. That time I had managed to change the code locally for our purpose.T