zjael / simple-proxy-agent

Simple agent for sending HTTP and HTTPS traffic through HTTP and SOCKS proxies
MIT License
25 stars 5 forks source link

Error when making a request through socks proxies #35

Open Tenclea opened 3 years ago

Tenclea commented 3 years ago

I keep getting the following error when making requests through socks proxies :
SocksClientError: An invalid destination host was provided.

My request looks like this :

const ProxyAgent = require('simple-proxy-agent');
// p is a proxy that looks like 'socks://79.xxx.xx.xxx:4153'
const res = await needle('get', 'https://google.com', {
    agent: new ProxyAgent(p),
    follow: 10,
    response_timeout: 10000,
    read_timeout: 5000,
}).catch(e => e);

Any ideas on why this could be happening ?