Here is the scenario.
I am using Mikael's request module for getting a web page content (HTML or XML). Now it is working okay without using the "proxy" parameter. But as soon as I provide the "proxy" parameter and put my proxy server (say http://myproxy.com:8008
) it stops and returns Invalid Authentication
I have used the same proxy in a PHP script using CURLOPT_PROXY
parameter which is working fine but on nodejs the "request" module is expecting some kind of authentication. Here is some of the code snippet I am using:
request({
jar: true,
headers: request_headers,
url: "http://www.osnews.com",
proxy: "http://myproxy.com:8008"
}, function(error, response, body){
console.log(body);
});
Any help would be appreciated. Thanks in advance