0

I am sending a GET request using a proxy. If I do not set tunneling to false I get an error as shown below:

Error: tunneling socket could not be established, cause=connect EINVAL 0.0.159.213:80 - Local (0.0.0.0:0)

If I set tunnel = false, I get the following error:

Invalid protocol: 188.168.58.130:

Code:

 const request = require('request');
 request({
   method: 'GET',
   url,
   proxy: "188.168.58.130:40917",
   tunnel: false
 }, (err, res, body) => { ... })
Rohan Dhar
  • 1,827
  • 1
  • 10
  • 21
  • See this answer https://stackoverflow.com/a/21281075/4664094 – James Gould Dec 03 '18 at 16:36
  • 1
    adding http:// worked. Though I am getting new error now: Exceeded maxRedirects. Probably stuck in a redirect loop. You can add this an answer, i'll accept. – Elminday Dec 03 '18 at 16:40
  • I'll just mark it as a duplicate, you can accept that manually and it'll redirect the question :) – James Gould Dec 03 '18 at 16:41
  • Possible duplicate of [How can I use an http proxy with node.js http.Client?](https://stackoverflow.com/questions/3862813/how-can-i-use-an-http-proxy-with-node-js-http-client) – James Gould Dec 03 '18 at 16:41

0 Answers0