Is possible in socket.io to check if a romm exist when an user try to join it? I want to show a 404 page using vue-router but I'm not sure if the io.sockets
object will contain all the sockets that are available.
Asked
Active
Viewed 1,197 times
1 Answers
1
Yes you can check if a room exists. All the rooms exist in the io object at this location: io.sockets.adapter.rooms
. If you look there you will see all rooms listed out with all the users in each room and the number of users.
Check this answer for more detail

Michael Mayo
- 1,266
- 1
- 5
- 7
-
Thanks for the answer. I will implement this into my code. – guggio May 19 '20 at 14:00
-
No problem, glad I could help! – Michael Mayo May 19 '20 at 14:25