Running multiple socket.io servers and connecting to them from one express website

411 views Asked by At

I need to make system what is used on page: https://www.csgohunt.com/

They have 3 socket.io servers running on: ws.csgohunt.com, chat.csgohunt.com, csgohunt.com

First two seems to be running on different http server, but when you connect to all 3 sockets from website csgohunt.com (You can see it from network tab), then all 3 sockets communictating.

Whats more interesting is, that even those 2 sockets what runs on different http server share express session and they know when user is logged and when not.

I have working Express + Socket.IO + Passport app where session sharing works fine when you connect to socket server running on same http server as express. But when I start nsecond socket server on different http server (but same app) and using same sessionStore, second server not see sessions.

Whats the best way to achieve this kind of system? I don't want to have 1 socket server for everything.

EDIT: I found that they using Heroku. Is this giving them possibility to do what I described? I have absolutely no expirience with it.

0

There are 0 answers