How to communicate between WebSocket clients in different deployed nodes on different ports?

2/15/2021

I have a WebSocket server and client implemented in nodejs, I will create multi-instance from the server using Kubernetes, if have 10 instances now from the server node and the clients will connect on it, and I will use the Nginx to distribute the requests of the clients on the server instances, say I have 100 clients connected if each server instance has 10 clients connected, and I want client in first server instance send something to a client in the second server instance how I can do this?

-- Mahmoud Aheed
javascript
kubernetes
node.js
websocket

1 Answer

2/15/2021

you can use Redis cluster as an engine of webSocket server, then k8s will look after data availability in any nodes

Redis Helm chart

-- stas smirnov
Source: StackOverflow