Socket IO Server to Server

前端 未结 3 1494
时光取名叫无心
时光取名叫无心 2020-12-04 19:37

Is it possible for a server to connect to another using Socket.IO and be treated like a client?

And have it join rooms, recieve io.sockets.in(\'lobby\').emit(). And

3条回答
  •  青春惊慌失措
    2020-12-04 20:01

    I had the same problem, but instead to use socket.io-client I decided to use a more simple approach (at least for me) using redis pub/sub, the result is pretty simple.

    You can take a look at my solution here: https://github.com/alissonperez/scalable-socket-io-server

    With this solution you can have how much process/servers you want (using auto-scaling solution), you just use redis as a way to forward your messages between your servers.

提交回复
热议问题