How do I find out the name of a room in socket.io?
Hello, in general, I'm learning how to work with rooms in Socket.io and there is this logic:
1 . The user clicks the button "Create a room" , then a room is created with the name
which is the creator's socket.id .
2 . Then everyone on the site in the "List of rooms" has a block where the name of the creator is written.
and there is a button "Login"
And then it never occurs to me how to make sure that the "Enter" button leads exactly to that room,
in the block of which it is located and I do not understand how to find out the name of this very room.
There was an idea to create an invisible input where value will contain the name of this room, but it seems to me
it's a collective farm.
P.S: In general, if there are labor-hards here that are already in their head
Store everything in a database and distribute to users) everything is simpleAnonymous
To place the code, please use CodePen or similar tool. Thanks you!