mattcg / socks5-https-client

SOCKS v5 HTTPS client implementation in JavaScript for Node.js.
186 stars 28 forks source link

ECONNREFUSED #10

Open shashvattrip opened 9 years ago

shashvattrip commented 9 years ago

Hey,

I am facing some issue with the module.

vents.js:85
      throw er; // Unhandled 'error' event
            ^
Error: connect ECONNREFUSED
    at exports._errnoException (util.js:746:11)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)

I am not sure how to proxy requests from nodejs to tor. I have tor running on my ubuntu and the browser running too with the tor-browser-en.sh I am not sure about what options I need to pass into the requst

require('socks5-https-client').request({
        'url': url, 
        strictSSL: true,
    agentClass: Agent,
    agentOptions: {
        // socksHost: 'my-tor-proxy-host', // Defaults to 'localhost'.
        socksPort: 9050 // Defaults to 1080.
        }
    }, function (error, response, body) {
//something
});

Please help. Thanks!