Closed aorfevre closed 5 years ago
Hi,
I'm having issues using proxies in 'Requests' module:
I have tried the following with proxy variable
IP:PORT http://IP:PORT https://IP:PORT tunnel: true / false
Nothing worked.
All good if i disable the proxy, i have tried thousands of proxies. i wrote 2 function to extract from 2 sources, no proxy worked even though the proxies are working using a proxy testing website (https://hidemyna.me/en/proxy-checker/)
Here is the part of my code sending requests:
var headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
....and some more usual headers....
};
var options = {
uri: url,
headers: headers,
proxy: proxy,
tunnel: true
};
let res = await requestpromise(options);
I get a lots of these errors:
Error: tunneling socket could not be established, cause=connect ECONNREFUSED 1.179.164.233:58387
OR
Error: tunneling socket could not be established, cause=write EPROTO 1020:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:252:
OR
Error: tunneling socket could not be established, cause=connect ETIMEDOUT 145.255.6.171:31252
OR
Error: tunneling socket could not be established, cause=Client network socket disconnected before secure TLS connection was established
Thanks.
For anyone with same issue:
I fixed it.
In this post, they say that Request handles https through http proxies, meaning https proxies will not work.
You can use request, I just found it's unbelievably easy to use proxy on node.js, just with one external "proxy" parameter, even more it supports HTTPS through a http proxy.
'https://stackoverflow.com/questions/3862813/how-can-i-use-an-http-proxy-with-node-js-http-client'
FIX: don't use HTTPS proxies with npm (Request) module.
Fixed all remaining sources
The following sources are not working on my side:
(checked = fixed)
To prevent bugs I have to use
sourcesBlacklist
to skip them. Anyone has maintained those sources?