Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple ratchet server instances behind HAProxy #280

Closed
drodil opened this issue Feb 11, 2015 · 1 comment
Closed

Multiple ratchet server instances behind HAProxy #280

drodil opened this issue Feb 11, 2015 · 1 comment
Labels

Comments

@drodil
Copy link

drodil commented Feb 11, 2015

Hi,

I have multiple servers running both websocket service (on top of Ratchet) and also the actual website. Currently user connects to the same ratchet instance with the actual website (with HAProxy cookie set). Now I have a problem when two users are connected to different servers the websocket messages are only sent through the same ratchet instance as the user is connected to.

Is there any way these ratchet servers can communicate with each other and publish the same messages on all nodes (ZeroMQ configuration perhaps?)? Or do I have to publish the same message to each and every instance individually?

Thanks for all the answers!

@cboden
Copy link
Member

cboden commented Apr 25, 2015

Sorry for the slow response @drodil

You're guess is correct. One way to connect the two running WebSocket servers is via ZeroMQ. If a message is to be delivered over a WebSocket the script that is initiating it would also broadcast that via ZMQ to the other WebSocket servers who would then relay the message to the intended clients.

A more advanced way of doing this is having a centralized message broker; but a similar concept.

@cboden cboden closed this as completed May 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants