Answer the question
In order to leave comments, you need to log in
Why doesn't node.js (socket.io) save user data?
Hello.
I am using socket.io and only need to send messages to 1 user inside a large room.
I have a room connection event. In it, I write the new user to the users object.
socket.on("connect to room", data => {
logger.info("Начал присоеденяться к комнате ", socket.id);
users.push({
audioOff: false,
videoOff: false,
id: socket.id,
roomId: data.roomId,
socket: socket,
username: data.username,
avatar: data.avatar
});
logger.info("Добавился в список пользователей", socket.id);
})
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