socket-redis is a WebSocket pub/sub server and client that exposes an API over Redis, allowing applications to use WebSocket functionality via a Redis client. Version 3.3.0 is current; the package is stable with low release cadence (last release Jan 2023). It bridges SockJS clients to Redis channels, supporting multi-core via child processes. Key differentiator: no direct WebSocket library dependency—uses Redis as the message bus, enabling decoupled architectures.
npm install socket-redisNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Starts a socket-redis server listening on port 8090, connecting to Redis at localhost:6379.
Use import syntax. If using TypeScript, set moduleResolution to node16 or nodenext.
Ensure client connects via SockJS protocol (e.g., new SockJS(url)) instead of new WebSocket(url).
Use a Redis proxy or modify source if custom channel names are required.
Use Prometheus /metrics endpoint instead.
Switch to import syntax: import { Server } from 'socket-redis'Correct: await server.start(); server.on('error', ...);Specify a different port via --socket-ports or socketPorts option.