Tuesday, 25 April 2017

node.js Https request through proxy fail

I'm trying to make an https request using a proxy.

            var agent = new HttpsProxyAgent(proxy_url);
            let options = {headers:headers, url:urlBase + item, agent}

           request(options, (error, response, html)=>{
                if(error){
                    console.log('error: ', error);
                    return reject('error');
                }
                let $ = cheerio.load(html);
                amazonProductParser.parse($);
            });

I'm getting different errors (400, 403, 407). The site I'm trying to connect to is amazon.com just in case that matters.



via irokhes

No comments:

Post a Comment