Registry / http-networking / socks5-https-client

socks5-https-client

JSON →
library1.2.1jsnpmunverified

This library provides a SOCKSv5 client specifically for making HTTPS requests within Node.js environments. It enables routing secure web traffic through a SOCKSv5 proxy, such as a local Tor instance. The package, currently at version 1.2.1, saw its last release in 2013 and is not actively maintained, which raises concerns about its compatibility with modern Node.js versions, updated security protocols, and potential vulnerabilities. It differentiates itself by focusing exclusively on HTTPS, requiring the separate `socks5-http-client` package for plain HTTP requests. Its primary utility has been for applications requiring anonymous or proxied HTTPS communication, though its abandoned status means developers should exercise caution. Due to its inactivity, there is no regular release cadence.

npm install socks5-https-client
INSTALL
IMPORT
SIG · SOCKS5-HTTPS-CLIEN
S
socks5-https-client
http-networkingjavascriptv1.2.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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.

shttps
const shttps = require('socks5-https-client');
import shttps from 'socks5-https-client';
This package is CommonJS-only. Direct ESM imports will fail. `shttps` is the main entry point for `get` and `request` methods.
Agent
const Agent = require('socks5-https-client/lib/Agent');
import { Agent } from 'socks5-https-client/lib/Agent';
The `Agent` class for integration with libraries like `request` is found via a deep import path and is CommonJS-only.
get
const shttps = require('socks5-https-client'); shttps.get(...);
import { get } from 'socks5-https-client';
The `get` function is a method on the `shttps` object returned by the main require call, not a named export.

Demonstrates making an HTTPS GET request through a SOCKSv5 proxy using the `shttps.get` method, with basic error handling.

const shttps = require('socks5-https-client'); shttps.get({ hostname: 'encrypted.google.com', path: '/', rejectUnauthorized: true, // This is the default. socksHost: 'localhost', socksPort: 1080 // Default SOCKS port }, function(res) { res.setEncoding('utf8'); res.on('readable', function() { process.stdout.write(res.read()); // Log response to console. }); res.on('end', () => { console.log('\nHTTPS request through SOCKS5 completed.'); }); res.on('error', (err) => { console.error('Response error:', err.message); }); }).on('error', (err) => { console.error('Request error:', err.message); });
Debug
Known issues
breakingThis package is CommonJS-only and does not support ES Modules natively. Attempting to `import` it will result in errors in modern Node.js ESM environments.
fix
Use `const someVar = require('package')` syntax. If your project is pure ESM, you may need a wrapper or alternative package.
affects: >=1.0.0
gotchaThe package is effectively abandoned, with the last release in 2013 and no recent maintenance. This means it may not be compatible with newer Node.js versions (e.g., >v16, >v18), recent OpenSSL changes, or security best practices.
fix
For new projects, consider modern, actively maintained SOCKS proxy client libraries, or use a reverse proxy that handles SOCKS for you. For existing projects, thoroughly test against your target Node.js version.
affects: >=1.0.0
gotchaThis library only supports HTTPS requests. For plain HTTP requests through SOCKSv5, a separate package `socks5-http-client` from the same author is required.
fix
If you need both HTTP and HTTPS, you must import and use `socks5-http-client` for HTTP and `socks5-https-client` for HTTPS.
affects: >=1.0.0
gotchaNode.js engine requirement is `>= 6.4.0`. While it might run on newer versions, its lack of updates means it has not been tested or optimized for changes in Node.js runtime, especially concerning networking or TLS.
fix
Verify compatibility with your target Node.js version through extensive testing. Be prepared for potential TLS handshake errors or deprecated API warnings on very new Node.js versions.
affects: >=1.0.0
Errors
Common errors & fixes
ReferenceError: require is not defined
Attempting to use `require()` in an ES Module context.
fix
Ensure your file is treated as CommonJS (e.g., `.js` file without `"type": "module"` in `package.json`, or explicitly `.cjs` extension) or use a modern, ESM-compatible SOCKS proxy client.
TypeError: shttps.get is not a function
Incorrect import of the `shttps` object when attempting an ES Module import.
fix
This package exports a default CommonJS module. Use `const shttps = require('socks5-https-client');` instead of `import shttps from 'socks5-https-client';`.
Error: self-signed certificate in certificate chain
The HTTPS server uses a self-signed or untrusted certificate, and `rejectUnauthorized` is true (the default).
fix
For testing or specific scenarios, set `rejectUnauthorized: false` in the options. For production, ensure the SOCKS proxy is correctly configured or the target server has a trusted certificate.
Upgrade
Version history
1.2.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
4
OpenAI (training)
2
Resources
socks5-https-client — npm install socks5-https-client · libregistry