Gathering detailed insights and metrics for @socket.io/redis-adapter
Gathering detailed insights and metrics for @socket.io/redis-adapter
Gathering detailed insights and metrics for @socket.io/redis-adapter
Gathering detailed insights and metrics for @socket.io/redis-adapter
@socket.io/redis-streams-adapter
The Socket.IO adapter based on Redis Streams, allowing to broadcast events between several Socket.IO servers
@sailshq/socket.io-redis
Production WebSocket/Socket.io adapter for realtime features in your Sails app.
socket.io-redis-adapter
The Socket.IO Redis adapter, allowing to broadcast events between several Socket.IO servers
socket.io-push-redis
redis operation for socket.io-push, include adapter, emitter, read/write
Adapter to enable broadcasting of events to multiple separate socket.io server nodes.
npm install @socket.io/redis-adapter
Typescript
Module System
Min. Node Version
Node Version
NPM Version
98.5
Supply Chain
99.5
Quality
75.5
Maintenance
100
Vulnerability
100
License
TypeScript (100%)
Total Downloads
26,228,271
Last Day
15,553
Last Week
318,606
Last Month
1,274,716
Last Year
11,387,068
MIT License
2,766 Stars
270 Commits
487 Forks
141 Watchers
4 Branches
49 Contributors
Updated on Jul 05, 2025
Minified
Minified + Gzipped
Latest Version
8.3.0
Package Id
@socket.io/redis-adapter@8.3.0
Unpacked Size
52.82 kB
Size
11.05 kB
File Count
9
NPM Version
9.6.7
Node Version
20.3.0
Published on
Mar 13, 2024
Cumulative downloads
Total Downloads
Last Day
21.5%
15,553
Compared to previous day
Last Week
3.5%
318,606
Compared to previous week
Last Month
11.7%
1,274,716
Compared to previous month
Last Year
42.6%
11,387,068
Compared to previous year
3
1
The @socket.io/redis-adapter
package allows broadcasting packets between multiple Socket.IO servers.
Table of contents
Feature | socket.io version | Support |
---|---|---|
Socket management | 4.0.0 | :white_check_mark: YES (since version 6.1.0 ) |
Inter-server communication | 4.1.0 | :white_check_mark: YES (since version 7.0.0 ) |
Broadcast with acknowledgements | 4.5.0 | :white_check_mark: YES (since version 7.2.0 ) |
Connection state recovery | 4.6.0 | :x: NO |
npm install @socket.io/redis-adapter
Redis Adapter version | Socket.IO server version |
---|---|
4.x | 1.x |
5.x | 2.x |
6.0.x | 3.x |
6.1.x | 4.x |
7.x and above | 4.3.1 and above |
redis
package1import { createClient } from "redis"; 2import { Server } from "socket.io"; 3import { createAdapter } from "@socket.io/redis-adapter"; 4 5const pubClient = createClient({ url: "redis://localhost:6379" }); 6const subClient = pubClient.duplicate(); 7 8await Promise.all([ 9 pubClient.connect(), 10 subClient.connect() 11]); 12 13const io = new Server({ 14 adapter: createAdapter(pubClient, subClient) 15}); 16 17io.listen(3000);
redis
package and a Redis cluster1import { createCluster } from "redis"; 2import { Server } from "socket.io"; 3import { createAdapter } from "@socket.io/redis-adapter"; 4 5const pubClient = createCluster({ 6 rootNodes: [ 7 { 8 url: "redis://localhost:7000", 9 }, 10 { 11 url: "redis://localhost:7001", 12 }, 13 { 14 url: "redis://localhost:7002", 15 }, 16 ], 17}); 18const subClient = pubClient.duplicate(); 19 20await Promise.all([ 21 pubClient.connect(), 22 subClient.connect() 23]); 24 25const io = new Server({ 26 adapter: createAdapter(pubClient, subClient) 27}); 28 29io.listen(3000);
ioredis
package1import { Redis } from "ioredis"; 2import { Server } from "socket.io"; 3import { createAdapter } from "@socket.io/redis-adapter"; 4 5const pubClient = new Redis(); 6const subClient = pubClient.duplicate(); 7 8const io = new Server({ 9 adapter: createAdapter(pubClient, subClient) 10}); 11 12io.listen(3000);
ioredis
package and a Redis cluster1import { Cluster } from "ioredis"; 2import { Server } from "socket.io"; 3import { createAdapter } from "@socket.io/redis-adapter"; 4 5const pubClient = new Cluster([ 6 { 7 host: "localhost", 8 port: 7000, 9 }, 10 { 11 host: "localhost", 12 port: 7001, 13 }, 14 { 15 host: "localhost", 16 port: 7002, 17 }, 18]); 19const subClient = pubClient.duplicate(); 20 21const io = new Server({ 22 adapter: createAdapter(pubClient, subClient) 23}); 24 25io.listen(3000);
Sharded Pub/Sub was introduced in Redis 7.0 in order to help scaling the usage of Pub/Sub in cluster mode.
Reference: https://redis.io/docs/interact/pubsub/#sharded-pubsub
A dedicated adapter can be created with the createShardedAdapter()
method:
1import { Server } from "socket.io"; 2import { createClient } from "redis"; 3import { createShardedAdapter } from "@socket.io/redis-adapter"; 4 5const pubClient = createClient({ host: "localhost", port: 6379 }); 6const subClient = pubClient.duplicate(); 7 8await Promise.all([ 9 pubClient.connect(), 10 subClient.connect() 11]); 12 13const io = new Server({ 14 adapter: createShardedAdapter(pubClient, subClient) 15}); 16 17io.listen(3000);
Minimum requirements:
redis@4.6.0
Note: it is not currently possible to use the sharded adapter with the ioredis
package and a Redis cluster (reference).
Name | Description | Default value |
---|---|---|
key | The prefix for the Redis Pub/Sub channels. | socket.io |
requestsTimeout | After this timeout the adapter will stop waiting from responses to request. | 5_000 |
publishOnSpecificResponseChannel | Whether to publish a response to the channel specific to the requesting node. | false |
parser | The parser to use for encoding and decoding messages sent to Redis. | - |
Name | Description | Default value |
---|---|---|
channelPrefix | The prefix for the Redis Pub/Sub channels. | socket.io |
subscriptionMode | The subscription mode impacts the number of Redis Pub/Sub channels used by the adapter. | dynamic |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 8/28 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
10 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More