Skip to content

New feature: add 'allow_override_connect' startup option #1203

@RJiazhen

Description

@RJiazhen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions