iMock Socket is a WebSocket cluster server and client library that combines Socket.IO with Redis for horizontal scaling. The current stable version is 0.0.28, released with a moderate cadence. It differentiates by offering a lightweight abstraction over Socket.IO with built-in Redis pub/sub for multi-server setups, making it suitable for real-time applications that need to scale across multiple nodes. It supports both server and client roles, integrates easily with Express, and is designed for Node.js 8.8+.
npm install imock-socketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up an iMock Socket server with Express and Redis, listens for connections, and demonstrates a basic echo response. Also shows client-side usage.
Pin to exact version in package.json.
Upgrade Node.js to 8.8+.
Check Socket.IO compatibility.
Ensure Redis is running and URL is correct.
Start Redis or set REDIS_URL env variable.
Wrap emits inside 'connect' event listener.
Use import statements or set type: 'module' in package.json and use .mjs extension.