Sending message to specific client with socket.io and empty message queue

后端 未结 9 2016
误落风尘
误落风尘 2020-12-22 20:16

I´m going crazy with socket.io! Documentation is so bad it\'s simply not true.

I want to send a feedback to specific client over socket.io

My server side loo

9条回答
  •  借酒劲吻你
    2020-12-22 20:48

    The correct way to do this in Socket.io 1.0+ is:

    io.to(users_socket_id).emit('new', 'hello');
    

    You can also substitute a room name for 'users_socket_id' to emit to a specific socket.io room.

提交回复
热议问题