How to use the to function from socket.io
Find comprehensive JavaScript socket.io.to code examples handpicked from public code repositorys.
GitHub: rahul8033/chatbox
53 54 55 56 57 58 59 60 61
io.emit('getUser', users); const us = users.filter(u => u.userId !== userId); const con = 'new_user_add'; for (var i = 0; i < us.length; i++) { socket.to(us[i].socketId).emit('new_user_add', con) } }) socket.on('sendMessage', (data) => {
0
0
1
+ 29 other calls in file
socket.io.on is the most popular function in socket.io (67 examples)