WebSocket Transport
Uses WebSocket instead of TCP, enabling Redis access from environments that don't support raw TCP connections.
A fork of ioredis using WebSockets instead of TCP
ioredis-serverless is a fork of ioredis, the popular Redis client for Node.js. It replaces the TCP transport layer with WebSockets to enable Redis connectivity in serverless and edge environments.
Most serverless platforms (Cloudflare Workers, Vercel Edge, etc.) do not allow raw TCP connections. They do, however, support WebSocket connections. ioredis-serverless bridges this gap by communicating with Redis over WebSockets.
Since Redis itself speaks TCP, a WebSocket-to-TCP proxy is required between the client and Redis server. The proxy translates WebSocket frames to Redis protocol and vice versa.
┌─────────────────┐ WebSocket ┌─────────────┐ TCP ┌─────────┐
│ Edge Function │ ───────────────── │ WS Proxy │ ──────────── │ Redis │
└─────────────────┘ └─────────────┘ └─────────┘