Skip to content

Socks5 support#680

Closed
mattcg wants to merge 4 commits into
request:masterfrom
mattcg:socks5
Closed

Socks5 support#680
mattcg wants to merge 4 commits into
request:masterfrom
mattcg:socks5

Conversation

@mattcg

@mattcg mattcg commented Oct 10, 2013

Copy link
Copy Markdown

This is a replacement for #648 and fixes #141.

The patch adds mattcg/socks5-http-client and mattcg/socks5-https-client as dependencies so that request can use the agent objects from both to support SOCKS proxying.

A test is included. To run it you should have a SOCKS5 server running on localhost:1080. Use the following command to start one if you have sshd running locally:

ssh -N -D 0.0.0.0:1080 localhost

@meteormatt

Copy link
Copy Markdown

👍

@Turbo87

Turbo87 commented Oct 17, 2013

Copy link
Copy Markdown
Contributor

now that the request library is using optional dependencies it would probably make sense to make this one optional as well. see the latest commits for examples on how to do that.

@mattcg

mattcg commented Oct 17, 2013

Copy link
Copy Markdown
Author

Done. It's now an optional dependency.

@Prestaul

Prestaul commented Nov 9, 2013

Copy link
Copy Markdown

A giant +1 for socks proxy support.

@olivierkaisin

Copy link
Copy Markdown

This is awesome!

@mattcg

mattcg commented Jan 9, 2014

Copy link
Copy Markdown
Author

I'm closing this pull request because the change is no longer compatible. The good news is that it's actually very easy to make requests without integrated support. Here's how you can make an HTTPS request via a SOCKS5 proxy, for example:

var Socks5ClientHttpsAgent = require('socks5-https-client/lib/Agent');

request({
  url: 'https://www.google.com/',
  agent: new Socks5ClientHttpsAgent({socksHost: 'tor-proxy-host', socksPort: 9050})
}, function(err, res) {
  // ...
});

@raitucarp

Copy link
Copy Markdown

socks proxy by mattcg is break on node 0.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Socks Proxy support

6 participants