socket.io - how to broadcast messages on a namespace?

前端 未结 4 991
一生所求
一生所求 2020-12-12 14:30

According to socket.io examples:

To broadcast, simply add a broadcast flag to emit and send method calls. Broad

4条回答
  •  感动是毒
    2020-12-12 14:52

    Maybe this will help someone

    socket.broadcast.to('room1').emit('updatechat', 'SERVER', username + ' has connected to this room'); 
    

    see

    Nodejs and Socketio Multiroom Chat Tutorial

提交回复
热议问题