M
M
Maks Pain2019-07-26 19:39:00
JavaScript
Maks Pain, 2019-07-26 19:39:00

How to make https request through proxy in node.js?

There is a request library: https://github.com/request/request#proxies
For some reason it does not work if you use it with a proxy, who faced such a problem? It gives the following error Error: tunneling socket could not be established , statusCode=400 should he be? real or ip proxy? so I tried using a similar needle library to do parsing through a proxy, so it still shows my real ip here is an example code

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grinat, 2019-07-27
@grinat

Digging around with network settings and request bugs, in fact, this moment is bugged to the very ears. And code 400 happens if there is something with the https certificate, you need to specify something somewhere in the settings and then the certificate validity check will be ignored.
The value of ip depends on the proxy, there are those that you can get a real ip, in my opinion they transmit it in a special header, but there are those that do not.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question