Answer the question
In order to leave comments, you need to log in
How to fix "tunneling socket could not be established" error?
const rp = require('request-promise'),
tnl = require('tunnel'),
url = 'https://google.ru';
let tunnel = tnl.httpsOverHttp({
proxy: {
host: 'x.x.x.x',
port: x
}
});
rp({
url: url,
method: 'GET',
headers: {
'User-Agent': 'Node js'
},
agent: tunnel,
resolveWithFullResponse: true,
timeout: 10000,
followRedirect: true,
maxRedirects: 10,
strictSSL: false
})
.then(response => {
console.log(response);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question