Skip to content
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

Multiple namespaces #6

Closed
heynikhil opened this issue May 7, 2021 · 2 comments
Closed

Multiple namespaces #6

heynikhil opened this issue May 7, 2021 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@heynikhil
Copy link

We have an option like give namespace,

instrument(global.io, {
    auth: false,
    namespaceName: '/',
});

What if we have dynamic namespaces?

@darrachequesne
Copy link
Member

Arf, that's a good remark.

Dynamic namespaces are currently not supported, since we register event listeners only once when calling instrument():

io._nsps.forEach((nsp) => registerListeners(adminNamespace, nsp));

Two possible solutions:

  • have a list of registered namespaces, and periodically check if there are new namespaces
  • make the server emit an event when a namespace is created

@darrachequesne darrachequesne added the bug Something isn't working label May 7, 2021
darrachequesne added a commit that referenced this issue Jun 2, 2021
This fix depends on the "new_namespace" event emitted by the server,
which was added in `socket.io@4.1.0`.

Related: #6
@darrachequesne
Copy link
Member

This should be fixed by 74f1c20, included in version 0.1.2.

@darrachequesne darrachequesne added this to the 0.1.2 milestone Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants