connect-redis-sse

Connect/Express middleware for publishing Server-Sent Events (EventSource) using Redis pub/sub.

Connect.js Server-Sent Events with Redis

Connect/Express middleware for publishing Server-Sent Events (EventSource) using Redis pub/sub.

// Attach the middleware 
connectRedisSse = require("connect-redis-sse");
app.use(connectRedisSse({redis: yourRedisClient}));
 
// Set up a subscription to a channel in your route 
app.get("/subscribe-me", function (reqres) {
  res.subscribe("channelName");
});