Registry / messaging / faye-redis

faye-redis

JSON →
library0.2.0jsnpmunverified

Redis backend engine for Faye, the Bayeux-compatible pub/sub messaging system. Current stable version 0.2.0 is the last release. This package provides a Redis-based engine for scaling Faye across multiple Node.js processes or machines. It uses Redis pub/sub for message distribution and stores client subscriptions. Ideal for applications requiring horizontal scalability with Faye. Compared to in-memory engines, it allows multiple Faye servers to share state. Note: only supports node engines >=0.4.0 (very old). No releases after 2012; consider alternatives like faye-redis-node or modern pub/sub solutions.

npm install faye-redis
INSTALL
IMPORT
SIG · FAYE-REDIS
F
faye-redis
messagingjavascriptv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RedisEngine
✓ const { RedisEngine } = require('faye-redis');
✗ import { RedisEngine } from 'faye-redis';
Package is CommonJS only; ES imports are unsupported. Use require().
default
✓ const RedisEngine = require('faye-redis');
✗ import RedisEngine from 'faye-redis';
CommonJS default export. ES import syntax will fail.

Sets up a Faye NodeAdapter with Redis engine for horizontal scaling using environment variables for Redis config.

const http = require('http'); const faye = require('faye'); const { RedisEngine } = require('faye-redis'); const server = http.createServer(); const bayeux = new faye.NodeAdapter({ mount: '/faye', timeout: 25 }); const redisEngine = new RedisEngine({ host: process.env.REDIS_HOST || 'localhost', port: process.env.REDIS_PORT || 6379, password: process.env.REDIS_PASSWORD || '', database: 0, namespace: 'faye:' }); bayeux.attach(server); // Set the Redis engine on the Faye server bayeux.getClient().setEngine(redisEngine); server.listen(8000, () => { console.log('Faye server with Redis engine running on port 8000'); });
Debug
Known issues
deprecatedPackage has not been updated since 2012. No longer maintained and may have security vulnerabilities.
fix
Migrate to alternative libraries like faye-redis-node or use modern pub/sub with socket.io.
affects: >=0.0.0
breakingRequires Node.js >=0.4.0 (very old). Will not work on modern Node.js versions (10+).
fix
Downgrade Node.js to a compatible version or use a maintained fork.
affects: >=0.2.0
gotchaThe engine must be set after attaching the adapter. Setting it before attach() will cause runtime errors.
fix
Call bayeux.attach(server) before bayeux.getClient().setEngine(redisEngine).
affects: >=0.1.0
deprecatedUses the old 'redis' npm package version 0.12.x which is unmaintained and may have known vulnerabilities.
fix
Use a fork that supports modern redis driver, or upgrade dependencies.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'faye-redis'
Package not installed or not in node_modules.
fix
Run 'npm install faye-redis' to install the package.
TypeError: bayeux.getClient(...).setEngine is not a function
Engine set before adapter is attached, or using wrong Faye version.
fix
Ensure bayeux.attach(server) is called before setEngine, and use Faye 1.x.
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
Redis server is not running or not accessible at the specified host/port.
fix
Start Redis server or check host/port environment variables.
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
redisrequiredRequired for Redis client connection
fayerequiredPeer dependency for Faye engine interface
Agent activity
16 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
faye-redis — npm install faye-redis · libregistry