Registry / http-networking / client-http

client-http

JSON →
library0.0.7jsnpmunverified

The `client-http` package, at its final release version 0.0.7, provided a simplified API for making HTTP/HTTPS requests in Node.js. Its core features included automatic proxy detection via the `http_proxy` environment variable, manual proxy configuration, basic cookie management, and automatic handling of HTTP 301/302 redirects. It also allowed for custom request headers and timeout settings. Development ceased due to the existence of the more comprehensive 'request' library, and the project is explicitly marked as abandoned by its maintainer. The library's `engines` configuration strictly targets very old Node.js versions (`>=0.6.11 <=0.7.0 || >=0.7.3`), making it fundamentally incompatible with modern Node.js runtimes and entirely unsuitable for current development due to severe security vulnerabilities and lack of maintenance. There is no ongoing release cadence.

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 library is CommonJS-only and does not support ES Modules syntax. Attempting to use `import` will result in a runtime error in modern Node.js.

const http = require('client-http');

Methods like `get` are exported as properties of the main `http` object, not as named exports from the module root.

const http = require('client-http'); http.get('http://example.com', (data, err, cookie, headers) => { /* ... */ });

Similar to `get`, `request` is a method on the `http` object. It supports POST requests with body and custom headers.

const http = require('client-http'); http.request('http://example.com', (data) => { /* ... */ }, 'body', { 'Content-Type': 'text/plain' });

This function globally configures the proxy for subsequent requests. It's not a per-request option.

const http = require('client-http'); http.setProxy('http://127.0.0.1:8080');

Demonstrates making basic HTTP GET requests to Google and Example.com, logging response data and showing how to set a global timeout.

const http = require('client-http'); // Make a simple HTTP GET request to Google http.get("http://www.google.com/", function(data, err, cookie, headers){ if (err) { console.error("Error:", err); return; } console.log("Response Data (truncated):"); console.log(data ? data.substring(0, 200) + '...' : '[No Data]'); console.log("Headers:", headers); }); // Example of setting a timeout http.setTimeout(5000); // Set timeout to 5 seconds http.get("https://www.example.com/", function(data, err){ if (err) { console.error("Timeout Error or other issue:", err); return; } console.log("Example.com response received within 5s."); });
Debug
Known footguns
breakingThe package is explicitly abandoned and has not received updates since its final release (0.0.7). It is highly insecure due to unpatched vulnerabilities in its dependencies and its own codebase.
breakingThis library is designed for extremely old Node.js versions (>=0.6.11 <=0.7.0 || >=0.7.3). It will not run correctly on modern Node.js versions (v10+, v12+, etc.) due to API changes, C++ addon incompatibilities, and updated security protocols.
gotchaThe API is entirely callback-based, which is an outdated pattern for asynchronous operations. It does not support Promises or `async/await`, making integration into modern JavaScript codebases cumbersome.
gotchaAutomatic proxy detection relies on the `http_proxy` environment variable. Manual proxy setting is global via `http.setProxy()`, not configurable per-request, which can be limiting for applications requiring fine-grained proxy control.
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
17 hits · last 30 days
gptbot
4
ahrefsbot
4
amazonbot
4
bytedance
4
script
1
Resources