New feature: add 'allow_override_connect' startup option #1234
RJiazhen
started this conversation in
Ideas & Feature requests
Replies: 1 comment 1 reply
-
Can you tell me more about your use case and your setup? In the default case, the IDs of the connections are public and not authenticated, so you could take over anyone's connections. I'm very open to overhauling the whole ID/permission thing in the near future, allowing server-generated and properly authenticated IDs, and then give more freedom on what you can do in case of a conflict. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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.
Beta Was this translation helpful? Give feedback.
All reactions