Answer the question
In order to leave comments, you need to log in
What is the principle of implementing "rooms" in node.js?
I want to implement this:
1. The user creates a room. A link to this room is automatically generated, for example, 127.0.0.1:3000/room/jdhjfheou439u94uil
2. Using the link, other users can join this room.
The problem is that I have one socket connection, regardless of the number of rooms, and I would like each room to have its own socket connection.
How to implement it?
Tried like this
app.get("/room/:hash", function(req, res) {
io.on("connection", function(socket) {});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question