-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connecting to custom namespace connects to default namespace, too #3089
Comments
Is it also by design that when the root namespace disconnects all other related namespace disconnects also? For example, these two IDs, yRvGKh9Svkp_yvvCAAAA and /otherNamepace#yRvGKh9Svkp_yvvCAAAA when the root yRvGKh9Svkp_yvvCAAAA ID is disconnected, it also disconnects the other namespace too. EDIT: This is false. It was an error in my code. Just thought I'd follow up. |
The biggest problem that I have with this is, if the default namespace has some middleware that might emit an error (e.g. authentication), when the client connects to some other namespace this middleware will (correctly?) stop the connection from succeeding, but it does not fire the |
For future readers: this was fixed in Socket.IO v3, the implicit connection to the default namespace was removed. Documentation: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/#No-more-implicit-connection-to-the-default-namespace |
You want to:
Current behaviour
const adminSocket = io('/admin', { forceNew: true });
will connect to Namespace "/" AND "/admin".Using this will connect to default namespace two times:
Im not sure if this is by design but if yes, it did not found it in the documentation.
Expected behaviour
Connecting to a namespace should not connect to default namespace
Setup
The text was updated successfully, but these errors were encountered: