Answer the question
In order to leave comments, you need to log in
How to send a message to a distributed system websocket?
There is a system
Web socket client connects to some server, as the balancer says, for example server 1.
The operator connects to server 2. The operator needs to send a web socket message to the client. How to implement it?
Answer the question
In order to leave comments, you need to log in
You need to somehow implement the pub/sub mechanism . For example, through redis . All servers subscribe to a redis channel. One of the servers publishes a message to the redis channel. All servers receive the message and then send it to their websocket clients.
A similar implementation for the socket.io library can be found here /
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question