@socket.io/redis-adapter is an adapter for Socket.IO that allows you to use Redis as a message broker to enable horizontal scaling. It facilitates communication between multiple Socket.IO servers by using Redis Pub/Sub mechanism.
What are @socket.io/redis-adapter's main functionalities?
Basic Setup
This code demonstrates the basic setup of the @socket.io/redis-adapter. It initializes a Socket.IO server and configures it to use Redis for message brokering.
This code shows how to broadcast events to all connected clients using the @socket.io/redis-adapter. When a 'message' event is received, it is broadcasted to all clients.
socket.io-emitter is a package that allows you to send events to Socket.IO servers from non-Socket.IO processes. It uses Redis to communicate with the Socket.IO servers, similar to @socket.io/redis-adapter, but is designed for external processes rather than internal server-to-server communication.
socket.io-redis is another adapter for Socket.IO that uses Redis Pub/Sub to enable horizontal scaling. It is very similar to @socket.io/redis-adapter, but @socket.io/redis-adapter is the more modern and actively maintained version.
Socket.IO Redis adapter
The @socket.io/redis-adapter package allows broadcasting packets between multiple Socket.IO servers.
sharded: allow to target a specific socket ID in dynamic mode (#525) (cca38dc)
sharded: fix count in fetchSockets() method (#523) (bd32763)
sharded: fix SSUBSCRIBE memory leak with ioredis (#529) (2113e8d)
Features
sharded: add an option for dynamic private channels (#526) (50220f4)
FAQs
The Socket.IO Redis adapter, allowing to broadcast events between several Socket.IO servers
The npm package @socket.io/redis-adapter receives a total of 165,151 weekly downloads. As such, @socket.io/redis-adapter popularity was classified as popular.
We found that @socket.io/redis-adapter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.
Package last updated on 13 Mar 2024
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.