mattcg / socks5-client

SOCKS v5 client socket implementation in JavaScript for Node.JS.
Other
56 stars 31 forks source link

export the Socks5ClientSocket constructor and proxy socket's "data" event #4

Closed tacticalchihuahua closed 10 years ago

tacticalchihuahua commented 10 years ago

this should close https://github.com/mattcg/socks5-client/issues/3

also, wanted to expose the Socks5ClientSocket constructor, since not all use cases will involve immediately opening the connection using createConnection()

now you should be able to:

var Socks5Client = require('socks5-client');
// create instance
var socket = new Socks5Client('localhost', 9050);
// or create connection
var connection = Socks5Client.createConnection({
  socksHost: 'localhost',
  socksPort: 9050,
  host: someHost,
  port: somePort
});
mattcg commented 10 years ago

Thanks for this @gordonwritescode. Just one thing that needs to be fixed (see the line comment).

tacticalchihuahua commented 10 years ago

oops! apologies! fixed.

mattcg commented 10 years ago

Thanks for the fix! And for using this library, too :)

tacticalchihuahua commented 10 years ago

no, thank you - i am using it at bitpay to enable support for connecting to the bitcoin network over Tor in our open source project bitcore

mattcg commented 10 years ago

Ah, it'd be awesome to see this used in bitcore!