node.jsproxyrequest

Proxy does not work in nodejs request module


var request = require('request');
    var proxyUrl = "http://" + 'EvjhdznB' + ":" + 'ouQEtyk7' + "@" + '5.188.222.111' + ":" + '8080';

var proxiedRequest = request.defaults({
      'proxy': proxyUrl
    });

    proxiedRequest.get("http://whoer.net", function (err, resp, body) {
      console.log(err)
      //console.log(resp)
    console.log(body)
    })

This proxy 'proxyUrl' work when connect to google.com but does not work for some other sites, for example whoer.net. it gives me this error

`502 Bad Gateway</h2><h3>Host Not Found or connection failed<`

also i have socks port 11319 for this proxy, and module request in nodejs gives another error

{ Error: Parse Error
    at Socket.socketOnData (_http_client.js:440:20)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:594:20) bytesParsed:

Solution

  • Ok, i found out that there are exist two types protocols ipv6 and ipv4, and my proxy works on ipv6, not much websites support new protocol and they work only on ipv4