Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

socks-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

socks-wrapper

Wrapping net.Socket to work with SOCKS proxies

  • 0.4.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 14 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc