Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 844 Bytes

File metadata and controls

19 lines (12 loc) · 844 Bytes

Scaling socketio example

This project represents next schema

image

So without redis by default a client connects to one server and interacts only with it. So if another client connects to another server it means that these two clients can't communicate with each other because servers are independent. So to share events between different servers we've added a redis as pub-sub mechanism.

NGINX in our case is a load balancer

Running the project

  • run docker-compose up
  • run a client with command PORT={any port} node client
  • open your browser and make a get reuest (localhost:{your port})
  • create as much clients as you wish
  • check your terminal
  • notice that we use APPID varibale to define what server was connected