Open zorro765 opened 8 years ago
@zorro765 this would be accomplished by using an http/https Agent. I haven't tried it but try using node-proxy-agent
. I'd love to have a test using this agent to validate.
@jcrugzz so... how can we solve this in 2018
Wanted to do a similar thing here, this is what I ended up doing:
var http = require('http'),
httpProxy = require('http-proxy'),
ProxyAgent = require('proxy-agent');
httpProxy.createProxyServer({
agent: new ProxyAgent('socks5://username:password@some-socks-proxy.com:9050'),
target:'http://localhost:9000'
}).listen(8000);
You want to use the agent
option when configuring this package. You can pass any regular Agent here, a popular one being the listed-above node-proxy-agent.
I have the following scenario: The target HTTP server is only reachable via SOCKS. So is there an easy way to hook a SOCKS client in-between node-http-proxy and the target HTTP server?
Kind regards.