Currently, when the peer server receives a connection request with the same connection ID as an existing one, it immediately returns an "ID-TAKEN" error and disconnects the connection.
However, I would like to add an "allow_override_connect" startup option (defaulting to false). When set to true, it should accept the connection request from the new client and send an "OVERRIDE_CONNECTION" error to the old client, then disconnect the old connection. Like this:
I have forked the peer-server and implemented the related functionality. However, due to the limitations in PeerJS regarding error types, the client cannot respond to this error directly. As a temporary solution, I am overriding the _handleMessage method to handle this response.
So, can we consider adding relevant startup options in peer-server and implementing corresponding response functionality in PeerJS?
I would also be happy to participate in the development of this feature.
Currently, when the peer server receives a connection request with the same connection ID as an existing one, it immediately returns an "ID-TAKEN" error and disconnects the connection.
However, I would like to add an "allow_override_connect" startup option (defaulting to false). When set to true, it should accept the connection request from the new client and send an "OVERRIDE_CONNECTION" error to the old client, then disconnect the old connection. Like this:
I have forked the peer-server and implemented the related functionality. However, due to the limitations in PeerJS regarding error types, the client cannot respond to this error directly. As a temporary solution, I am overriding the _handleMessage method to handle this response.
So, can we consider adding relevant startup options in peer-server and implementing corresponding response functionality in PeerJS?
I would also be happy to participate in the development of this feature.