This package provides a SOCKS v5 HTTP client implementation specifically for Node.js environments. It enables making HTTP requests through a SOCKS5 proxy, commonly used for anonymizing traffic via services like Tor. The current stable version is 1.0.4, last published over eight years ago (July 2018). The library focuses solely on HTTP, explicitly directing users to a separate `socks5-https-client` package for HTTPS. Its primary differentiators were its straightforward integration with the deprecated `request` library and its direct support for SOCKS5 proxying, including authentication. Due to its age and lack of updates, it is largely incompatible with modern Node.js versions and lacks contemporary features like Promise-based APIs.
npm install socks5-http-clientVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to make a basic HTTP GET request through a SOCKS5 proxy configured via environment variables, logging the initial part of the response body.
Migrate to a actively maintained SOCKS5 client library for Node.js, such as `socks-proxy-agent` or explore `node-fetch` with a custom agent.
Do not use this package for new projects or in security-sensitive environments. Replace with a well-maintained and audited SOCKS5 client.
For HTTPS, you must use a different library. If you need a combined solution, look for more comprehensive proxy agents.
Avoid integrating with the deprecated `request` library. If using this package, use it directly with Node's native `http` module or choose a modern HTTP client with SOCKS support.
Stick to `require()` syntax for importing this package. For modern applications, consider libraries that offer native ESM support.
Ensure `npm install` has been run in your project root, or check your `NODE_PATH` environment variable if using global modules. This can also indicate issues with older Node.js versions.
This package is not compatible with modern Node.js versions (specifically, likely >14.17.0). Downgrade Node.js or, preferably, migrate to a current, maintained SOCKS5 client library.
Verify that `socksHost` and `socksPort` are correct. Ensure the SOCKS5 proxy is running and accessible from the machine running the Node.js application. Check firewall rules.
This package is abandoned and incompatible with recent Node.js versions. Upgrade to a modern, actively maintained SOCKS proxy agent (e.g., `https-proxy-agent` or `socks-proxy-agent`).