Skip to content

Simple demo of using socket io redis adapter for scaling sockets

Notifications You must be signed in to change notification settings

cristijora/socketio-scale-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

socketio-scale-demo

Simple demo of using socket io redis adapter for scaling sockets

How to use it

  1. npm install
  2. Run PORT=3000 node index.js from one terminal
  3. Run PORT=3001 node index.js from another terminal
  4. Open both urls in browser and try typing some message on both.
  5. You can see that messages are sent between those server processes and displayed on web page.
  6. Try to Remove
var redis = require('socket.io-redis');
io.adapter(redis({ host: 'localhost', port: 6379 }));

To see that in this case, the messages won't be sent to both server instances.

About

Simple demo of using socket io redis adapter for scaling sockets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published