Registry / http-networking / http-forward

http-forward

JSON →
library0.1.3jsnpmunverified

http-forward is a minimalist Node.js library designed to proxy incoming HTTP requests to a specified target URL. It functions by attaching a `target` property to the `req.forward` object, allowing for basic request redirection within a Node.js `http.createServer` instance. This package is extremely lightweight and relies solely on Node.js's built-in `http` module. However, with its last publish date over ten years ago (version 0.1.3) and no apparent ongoing development, it is considered abandoned. It does not support modern JavaScript module syntax (ESM), HTTP/2, or contemporary security practices, and has no release cadence. Users are strongly advised to consider actively maintained and more feature-rich alternatives such as `http-proxy` or `http-proxy-middleware` for any new or existing projects requiring HTTP proxying in Node.js.

http-networking
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

This package is CommonJS-only and does not support ES module `import` syntax. It was published long before ESM was standardized in Node.js.

const forward = require('http-forward')

This example sets up a simple proxy server on port 3000 that forwards all incoming HTTP requests to a target server running on port 9000.

const http = require('http'); const forward = require('http-forward'); // A basic target server to forward requests to const targetServer = http.createServer((req, res) => { console.log(`Target server received: ${req.method} ${req.url}`); res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('Hello from the target server!'); }); targetServer.listen(9000, () => { console.log('Target server listening on port 9000'); }); // The proxy server that uses http-forward const proxyServer = http.createServer((req, res) => { console.log(`Proxy server received: ${req.method} ${req.url}`); // Define the target for http-forward req.forward = { target: 'http://localhost:9000' }; forward(req, res, (err) => { if (err) { console.error('Proxy error:', err.message); res.writeHead(500, { 'Content-Type': 'text/plain' }); res.end('Proxy Error'); } }); }); proxyServer.listen(3000, () => { console.log('Proxy server listening on port 3000. Try curl http://localhost:3000'); });
Debug
Known footguns
breakingThe `http-forward` package is abandoned and has not been updated in over ten years. It should not be used in production environments due to potential unpatched security vulnerabilities and incompatibility with modern Node.js versions and features.
gotchaThis package is CommonJS-only and relies on `require()` statements. It does not support ES Modules (`import`/`export`) or modern JavaScript bundling techniques, which can lead to compatibility issues in contemporary Node.js projects.
gotchaDue to its age, `http-forward` lacks support for modern web protocols like HTTP/2 and advanced proxy features such as WebSocket forwarding, SSL/TLS termination at the proxy, or sophisticated routing rules.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
ahrefsbot
4
amazonbot
4
script
1
Resources