{"id":17189,"library":"client-http","title":"Node.js Client HTTP/HTTPS Request Wrapper","description":"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.","status":"abandoned","version":"0.0.7","language":"javascript","source_language":"en","source_url":"https://github.com/hkbarton/node-client-http/","tags":["javascript","http","https","proxy","cookie"],"install":[{"cmd":"npm install client-http","lang":"bash","label":"npm"},{"cmd":"yarn add client-http","lang":"bash","label":"yarn"},{"cmd":"pnpm add client-http","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used for HTTPS tunneling through an HTTP proxy.","package":"node-tunnel","optional":false}],"imports":[{"note":"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.","wrong":"import http from 'client-http';","symbol":"client-http","correct":"const http = require('client-http');"},{"note":"Methods like `get` are exported as properties of the main `http` object, not as named exports from the module root.","wrong":"import { get } from 'client-http';","symbol":"http.get","correct":"const http = require('client-http');\nhttp.get('http://example.com', (data, err, cookie, headers) => { /* ... */ });"},{"note":"Similar to `get`, `request` is a method on the `http` object. It supports POST requests with body and custom headers.","wrong":"import { request } from 'client-http';","symbol":"http.request","correct":"const http = require('client-http');\nhttp.request('http://example.com', (data) => { /* ... */ }, 'body', { 'Content-Type': 'text/plain' });"},{"note":"This function globally configures the proxy for subsequent requests. It's not a per-request option.","wrong":"import { setProxy } from 'client-http';","symbol":"http.setProxy","correct":"const http = require('client-http');\nhttp.setProxy('http://127.0.0.1:8080');"}],"quickstart":{"code":"const http = require('client-http');\n\n// Make a simple HTTP GET request to Google\nhttp.get(\"http://www.google.com/\", function(data, err, cookie, headers){\n    if (err) {\n        console.error(\"Error:\", err);\n        return;\n    }\n    console.log(\"Response Data (truncated):\");\n    console.log(data ? data.substring(0, 200) + '...' : '[No Data]');\n    console.log(\"Headers:\", headers);\n});\n\n// Example of setting a timeout\nhttp.setTimeout(5000); // Set timeout to 5 seconds\nhttp.get(\"https://www.example.com/\", function(data, err){\n    if (err) {\n        console.error(\"Timeout Error or other issue:\", err);\n        return;\n    }\n    console.log(\"Example.com response received within 5s.\");\n});","lang":"javascript","description":"Demonstrates making basic HTTP GET requests to Google and Example.com, logging response data and showing how to set a global timeout."},"warnings":[{"fix":"Migrate to a actively maintained and secure HTTP client library like `axios`, `node-fetch`, or Node.js's built-in `http`/`https` modules.","message":"The 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.","severity":"breaking","affected_versions":"0.0.7"},{"fix":"Do not use this package in any current or recent Node.js environment. It is incompatible and will cause runtime errors or unexpected behavior.","message":"This 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.","severity":"breaking","affected_versions":"0.0.7"},{"fix":"If migrating, adapt your logic to use modern async patterns (Promises, `async/await`) with a contemporary HTTP client library.","message":"The 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.","severity":"gotcha","affected_versions":"0.0.7"},{"fix":"For per-request proxy settings or more robust proxy management, a different library is required.","message":"Automatic 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.","severity":"gotcha","affected_versions":"0.0.7"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"This library is CommonJS-only. If you must use it (which is strongly discouraged), ensure your file is treated as CommonJS (e.g., `.js` file without `\"type\": \"module\"` in `package.json`) and use `const http = require('client-http');`.","cause":"Attempting to import `client-http` using `import` syntax in a Node.js ES Module project.","error":"Error: require() of ES Module ... not supported"},{"fix":"This error signifies fundamental incompatibility with modern Node.js security standards. The only 'fix' is to *not use* this abandoned library. As a temporary workaround for *testing purposes only* (never in production), you can set `NODE_OPTIONS='--openssl-legacy-provider'` environment variable, but this significantly reduces security and does not resolve other issues.","cause":"Running `client-http` on modern Node.js versions (e.g., Node.js 17+) where legacy OpenSSL ciphers and hash functions used by the old library or its dependencies are disabled by default.","error":"Error: ERR_OSSL_EVP_UNSUPPORTED"},{"fix":"This is an installation-time warning/error indicating the package is not designed for your Node.js version. It's a strong signal to *not* use this library. There is no practical fix for using it with modern Node.js.","cause":"Node Package Manager (npm) or Yarn attempting to install `client-http` when the current Node.js version falls outside the very narrow range specified in the `package.json` engines field (`>=0.6.11 <=0.7.0 || >=0.7.3`).","error":"Error: The 'engines' field is defined with an unsupported Node.js version."}],"ecosystem":"npm","meta_description":null}