What is the proper way to manage multiple chat rooms with socket.io?

前端 未结 2 897
温柔的废话
温柔的废话 2021-01-31 05:48

What is the proper way to manage multiple chat rooms with socket.io?

So on the server there would be something like:

io.sockets.on(\'connection\', functi         


        
2条回答
  •  礼貌的吻别
    2021-01-31 06:25

    Update: Both Now.js and Bridge are now dead, see now.js dead and bridge dead. Socket.io seems to have adopted the callback feature as of v0.9, which is a good step forward.

    While it isn't directly Socket.io related, Now.js (a higher level abstraction ontop of Socket.io) supports groups - http://nowjs.com/doc

    They have a multi-room-chat example in their offocial repo here: https://github.com/Flotype/now/blob/master/examples/multiroomchat_example/multiroomchat_server.js

提交回复
热议问题