0

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.

guggio
  • 201
  • 5
  • 18

1 Answers1

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