http-proxy-to-socks
http-proxy-to-socks copied to clipboard
Proxy is not working if port is specified
If port is specified, getting the following error 2019-9-16 16:44:27 - error Socket Closed on proxy 127.0.0.1:4321
It seems that if port is specified, it gets into the parsed hostname which cannot be resolved by dns. The problem is because url.parse returns host WITH the port. The solution is to simply use hostname field
> ph = url.parse(`http://google.com:2222`);
Url {
protocol: 'http:',
slashes: true,
auth: null,
host: 'google.com:2222',
port: '2222',
hostname: 'google.com',
hash: null,
search: null,
query: null,
pathname: '/',
path: '/',
href: 'http://google.com:2222/' }
>
@erivni
PR can be closed, re-opened https://github.com/oyyd/http-proxy-to-socks/pull/10 under proper account