V
V
v131v2019-11-19 17:44:43
Node.js
v131v, 2019-11-19 17:44:43

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);
});

On startup it gives Error: tunneling socket could not be established, cause=connect ETIMEDOUT
How to fix this? I've checked a lot of similar questions, but nothing helps. I use valid proxies.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question