Registry / http-networking / rocky
library1.0.2jsnpmunverified

A full-featured, middleware-oriented HTTP/S and WebSocket proxy with traffic replay, load balancing, routing, and retry/backoff. Current stable version is 0.4.16, last updated July 2020. It is built on top of http-proxy and supports both command-line and programmatic usage. Key differentiators include a hierarchical middleware layer, path-based routing with params, concurrent/sequential traffic replay, and connectivity with Connect/Express middleware. Compared to alternatives like http-proxy or http-mitm-proxy, Rocky provides a higher-level abstraction with built-in balancer and retry logic. The project is in maintenance mode; no major releases since 2020.

npm install rocky
INSTALL
IMPORT
SIG · ROCKY
R
rocky
http-networkingjavascriptv1.0.2
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

rocky
✓ const rocky = require('rocky')
✗ import rocky from 'rocky'
CommonJS only; no ESM support. The default export is the factory function.
rocky.balancer
✓ const balancer = require('rocky').balancer
Balancer is exposed as a property on the rocky object.
RockyMiddleware
✓ const Rocky = require('rocky'); const proxy = Rocky(); proxy.use((req, res, next) => next())
✗ proxy.use(middleware) without calling next()
Middleware signature is (req, res, next) similar to Express; must call next() to continue.

Sets up a simple HTTP proxy that forwards all traffic to httpbin.org, with middleware hooks for forward and replay phases.

const rocky = require('rocky'); const proxy = rocky(); // Forward all traffic to httpbin proxy .target('http://httpbin.org') .forward(async (req, res, next) => { console.log('Forward request:', req.url); await next(); }) .replay(async (req, res, next) => { console.log('Replay response:', res.statusCode); await next(); }); proxy.listen(3000, () => { console.log('Rocky proxy listening on port 3000'); }); // Test: curl -x http://localhost:3000 http://httpbin.org/get
rocky --version
Debug
Known issues
deprecatedretry feature is temporarily not available in latest Node.js versions (see README note).
fix
Disable retry or avoid using retry options; consider implementing retry manually.
affects: >=0.4.0
gotchaThe default export is a function that creates a new proxy instance; not a class constructor.
fix
Use const proxy = require('rocky')() to create an instance.
affects: all
gotchaMiddleware must call next() or the request hangs. Rocky does not automatically call next().
fix
Ensure every middleware function ends with await next() or next() (if not async).
affects: all
breakingIn version 0.3.x, the proxy was created via new Rocky(), but in 0.4.x it changed to factory function.
fix
Use rocky() instead of new rocky()
affects: >=0.4.0
gotchaWebSocket proxy does not support replay to multiple backends.
fix
Use forward only for WebSocket; replay not available.
affects: all
Errors
Common errors & fixes
TypeError: rocky is not a function
Using import instead of require with CommonJS module.
fix
Change to const rocky = require('rocky')
Error: EADDRINUSE :::3000
Port already in use by another process.
fix
Kill the process using the port or choose a different port.
rocky().target is not a function
Forgot to call rocky() to create an instance; using module directly.
fix
Create an instance: const proxy = require('rocky')()
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
http-proxyrequiredCore proxy functionality for HTTP and WebSocket proxying
Agent activity
5 hits · last 30 days
node
4
Resources
rocky — npm install rocky · libregistry