SOCKS5 HTTPS Client for Node.js

1.2.1 · abandoned · verified Tue Apr 21

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.

Common errors

Warnings

Install

Imports

Quickstart

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);
});

view raw JSON →