We are currently building a desktop application in node-webkit and we need to send http requests to a remote server. For this we decided to use request, a http wrapper module for node.
This works fine on all but one of our machines. The code for the download looks a bit like this:
var options = {
url: url
};
request.post(options
, function (error, response, body)
{
if (!error && response.statusCode == 200)
{
cb && cb(null, body);
}
}
).on('error', function (err)
{
}).pipe(writeStream);
On our network here the proxy server is 172.24.8.14 and my address is 172.24.9.130. Node sent the request through the proxy server which contacted the target server. The result that is sent back is a 301 which is expected.
This time Node attempted to send the request directly to the target server. This resulted in the proxy blocking the request completely.
The strange thing is that we do not specify a proxy in our code however the requests do seem to go through the proxy...but not on the other machine.
Is there some reason for this? How is node somehow detecting the proxy and sending the request to the proxy?
The reason for this turned out to be that our network was using an NTLM proxy which required ISA client to be running on our machines but it was not running on the other machine. Installing ISA client on that machine allowed traffic to go through the proxy as normal.