{"id":15831,"library":"socks5-https-client","title":"SOCKS5 HTTPS Client for Node.js","description":"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.","status":"abandoned","version":"1.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/mattcg/socks5-https-client","tags":["javascript","socks5","socksv5","socks","v5","https","ssl","tls","tor"],"install":[{"cmd":"npm install socks5-https-client","lang":"bash","label":"npm"},{"cmd":"yarn add socks5-https-client","lang":"bash","label":"yarn"},{"cmd":"pnpm add socks5-https-client","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is CommonJS-only. Direct ESM imports will fail. `shttps` is the main entry point for `get` and `request` methods.","wrong":"import shttps from 'socks5-https-client';","symbol":"shttps","correct":"const shttps = require('socks5-https-client');"},{"note":"The `Agent` class for integration with libraries like `request` is found via a deep import path and is CommonJS-only.","wrong":"import { Agent } from 'socks5-https-client/lib/Agent';","symbol":"Agent","correct":"const Agent = require('socks5-https-client/lib/Agent');"},{"note":"The `get` function is a method on the `shttps` object returned by the main require call, not a named export.","wrong":"import { get } from 'socks5-https-client';","symbol":"get","correct":"const shttps = require('socks5-https-client');\nshttps.get(...);"}],"quickstart":{"code":"const shttps = require('socks5-https-client');\n\nshttps.get({\n\thostname: 'encrypted.google.com',\n\tpath: '/',\n\trejectUnauthorized: true, // This is the default.\n    socksHost: 'localhost',\n    socksPort: 1080 // Default SOCKS port\n}, function(res) {\n\tres.setEncoding('utf8');\n\tres.on('readable', function() {\n\t\tprocess.stdout.write(res.read()); // Log response to console.\n\t});\n    res.on('end', () => {\n        console.log('\\nHTTPS request through SOCKS5 completed.');\n    });\n    res.on('error', (err) => {\n        console.error('Response error:', err.message);\n    });\n}).on('error', (err) => {\n    console.error('Request error:', err.message);\n});","lang":"javascript","description":"Demonstrates making an HTTPS GET request through a SOCKSv5 proxy using the `shttps.get` method, with basic error handling."},"warnings":[{"fix":"Use `const someVar = require('package')` syntax. If your project is pure ESM, you may need a wrapper or alternative package.","message":"This 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.","severity":"breaking","affected_versions":">=1.0.0"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"If you need both HTTP and HTTPS, you must import and use `socks5-http-client` for HTTP and `socks5-https-client` for HTTPS.","message":"This library only supports HTTPS requests. For plain HTTP requests through SOCKSv5, a separate package `socks5-http-client` from the same author is required.","severity":"gotcha","affected_versions":">=1.0.0"},{"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.","message":"Node.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.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"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.","cause":"Attempting to use `require()` in an ES Module context.","error":"ReferenceError: require is not defined"},{"fix":"This package exports a default CommonJS module. Use `const shttps = require('socks5-https-client');` instead of `import shttps from 'socks5-https-client';`.","cause":"Incorrect import of the `shttps` object when attempting an ES Module import.","error":"TypeError: shttps.get is not a function"},{"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.","cause":"The HTTPS server uses a self-signed or untrusted certificate, and `rejectUnauthorized` is true (the default).","error":"Error: self-signed certificate in certificate chain"}],"ecosystem":"npm"}