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

rainbowsocks

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rainbowsocks

SOCKS4a proxy client

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

rainbowsocks

SOCKS4a client developed with rainbows

Install

npm install rainbowsocks

API

var rainbowsocks = new RainbowSocks(port, [host])

  • port - Socks4a Proxy Port
  • host - SOCKS4a Proxy Host || 127.0.0.1
rainbowsocks.connect(targetHost, targetPort, callback)

Pseudo function of rainbowsocks.request to establish a TCP/IP stream connection

  • targetHost - IP/Domain of desired destination
  • targetPort - Port of desired destination
  • callback - Called with signature of (err, socket)
rainbowsocks.bind(targetHost, targetPort, callback)

Pseudo function of rainbowsocks.request to establish a TCP/IP port binding

  • targetHost - IP/Domain of desired destination
  • targetPort - Port of desired destination
  • callback - Called with signature of (err, socket)
rainbowsocks.request(cmdBuf, domain, port, callback)

Sends a request to proxy to take a specific action

  • cmdBuf - 1 Octet Buffer containg SOCKS4a action code
  • targetHost - IP/Domain of desired destination
  • targetPort - Port of desired destination
  • callback - Called with signature of (err, socket)
Event: connect

Connected to proxy

Example

var RainbowSocks = require('rainbowsocks');
var sock = new RainbowSocks(8080, '192.168.0.45');

sock.on('connect', function() {
  console.log('Connected to proxy');
  sock.connect('www.google.com', 80, function(err, socket) {
    if(err) throw err;
    console.log('Connected to www.google.com');
    socket.write('GET / HTTP/1.1\nHost: www.google.com\n\n');
    socket.pipe(process.stdout);
  });
});

Licence

MIT

Keywords

FAQs

Package last updated on 07 Oct 2015

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