0.4.2 • Published 5 years ago

socks-wrapper v0.4.2

Weekly downloads
3
License
-
Repository
github
Last release
5 years ago

Socket Wrapper Class for SOCKS Proxies

A minimal wrapper class for net.Socket to make a socket work with SOCKS proxies transparently. Socks wrapper currently supports SOCKS 4 and SOCKS 4a.

Example with HTTP

var http    = require('http'),
    url     = require('url'),
    wrapper = require('socks-wrapper'),
    options = url.parse('http://www.google.com');

options.agent = new wrapper.HttpAgent(9050, 'localhost');

var req = http.get(options, function(res) {
    res.on('data', function(data) {
        console.log('DATA: ' + data);
    }); 
})

req.end();

Example with HTTPS

var https   = require('https'),
    url     = require('url'),
    wrapper = require('socks-wrapper'),
    options = url.parse('https://encrypted.google.com');

options.agent = new wrapper.HttpsAgent(9050, 'localhost');

var req = https.get(options, function(res) {
    res.on('data', function(data) {
        console.log('DATA: ' + data);
    }); 
})

req.end();
0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

6 years ago

0.3.1

6 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

10 years ago