Registry / devops / failoverproxy

failoverproxy

JSON →
library0.1.2jsnpmunverified

An HTTP proxy with multi-backend failover support and GET caching for Node.js (v0.1.2, compatible with Node >=0.10.5). It proxies incoming requests to a list of backends, automatically failing over to the next available backend if one is down, and can serve cached responses from a configurable cache driver (default fs). Useful for building resilient proxy layers. Supports both URL and object-based backend definitions, configurable timeouts, and backend health monitoring via periodic HTTP tests.

npm install failoverproxy
INSTALL
IMPORT
SIG · FAILOVERPROXY
F
failoverproxy
devopsjavascriptv0.1.2
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.

failoverproxy
require('failoverproxy')
import failoverproxy from 'failoverproxy'
Package is CommonJS only, no ES module support.
FailoverProxy
const { FailoverProxy } = require('failoverproxy')
const FailoverProxy = require('failoverproxy').FailoverProxy
Named export is available for programmatic usage.
createProxy
const { createProxy } = require('failoverproxy')
const createProxy = require('failoverproxy').createProxy
Same as FailoverProxy, named export.

Creates a failoverProxy instance with two server backends and a cache backend, then starts the proxy.

const { createProxy } = require('failoverproxy'); const proxy = createProxy({ local: { address: '0.0.0.0', port: 8086 }, backends: [ { host: '127.0.0.1', port: 8087 }, 'http://192.168.1.100:8080/', 'cache' ], cache: { driver: 'fs', path: '/tmp/cache', expireTime: 3600000 }, httpTimeout: 5000, backendWatchInterval: 10000 }); proxy.on('error', (err) => console.error(err)); proxy.start();
Debug
Known issues
breakingNode.js version requirement: engine >=0.10.5. May not work on newer versions.
fix
Use a compatible Node.js version (0.10.x or 0.12.x) or check for updates.
affects: >=0.10.5
deprecatedPackage appears unmaintained: last release 2015, no updates in years.
fix
Consider alternatives like http-proxy-agent, http-proxy, or custom solutions.
affects: >=0.1.0
gotchaCache backend uses 'fs' driver by default; path is required for fs driver but not validated.
fix
Always specify a path for cache backends: { type: 'cache', driver: 'fs', path: './cache' }.
affects: >=0.0.0
gotchaBackend selector defaults to first active backend; custom selector must be provided as function.
fix
Provide a backendSelector function if different behavior is needed.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'failoverproxy'
Package not installed globally or locally.
fix
Run `npm install failoverproxy` in your project directory.
TypeError: failoverproxy is not a function
Using ES6 import syntax incorrectly.
fix
Use `const { createProxy } = require('failoverproxy');`
Error: listen EADDRINUSE :::8086
Port 8086 already in use.
fix
Change the local port in config or kill the process using that port.
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
failoverproxy — npm install failoverproxy · libregistry