Answer the question
In order to leave comments, you need to log in
How to get room name in socket.io?
Hello, in general, I am learning to work with rooms in Socket.io and there is such logic:
1 . The user presses the "Create room" button , then a room is created, the name of
which is the creator's socket.id .
2 . Then everyone on the site in the "List of rooms" has a block where the creator's name is written and there is a "Login"
button .
And then it doesn't occur to me how to make the "Login" button lead exactly to the room
in the block of which it is is located and I don’t understand how to find out the name of this very room at all.
There was an idea to create an invisible input where in value
will be the name of this room, but it seems to me that
this is a collective farm.
PS: In general, if there are true hards who have already
written this code in their heads and know how it works, can you tell me the logic?
Answer the question
In order to leave comments, you need to log in
Store everything in the database and distribute to users) everything is simple
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question