Socket io v2 to v3: Default namespace is not connected anymore #4953
Answered
by
darrachequesne
SamTV12345
asked this question in
Q&A
-
We at Etherpad have the problem that the default namespace isn't connected if I connect to another namespace. Thus the normal sessionMiddlewares aren't being called. Do you know a way how to get this behaviour back? |
Beta Was this translation helpful? Give feedback.
Answered by
darrachequesne
Feb 21, 2024
Replies: 1 comment 5 replies
-
Hi! This is indeed a pretty big change when migrating from v2 to v3. You should be able to register the middleware on your other namespace: io.of("/my-other-namespace").use(sessionMiddleware); Reference: https://socket.io/docs/v4/server-api/#namespaceusefn See also: https://socket.io/how-to/register-a-global-middleware |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
SamTV12345
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
This is indeed a pretty big change when migrating from v2 to v3.
You should be able to register the middleware on your other namespace:
Reference: https://socket.io/docs/v4/server-api/#namespaceusefn
See also: https://socket.io/how-to/register-a-global-middleware