You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 31, 2019. It is now read-only.
Hi,
I've been trying to get socketio-auth working with a site that uses namespaces. I could be missing something but I think I've found an issue and written a fix that works for me on my fork.
What do you think?
Thanks,
Scott
Problem:
socketio-auth only listens for incoming connection events on the io object itself, not on each namespace.
When an incoming socket connection to a namespace opens on the server, it seems to add a socket to the root namespace and the namespace it connected to (they have the same socket ids, however).
The authentication message from the client comes in on the namespace socket and not the root namespace one. The message is missed because socketio-auth is listening on the root socket.
The timeout then fires and disconnects the root socket which disconnects the client socket.
Proof of concept fix on my fork:
Add connection listeners to all namespaces, each with their own timeout.
If a socket is authenticated, search each namespace for sockets with the same id and for each of these sockets: