node.js HTTP requests constantly fail on my machine. I have no idea what is going on. I run this dead simple script:
var http = require("http");
var options = {
host: 'www.google.com',
port: 80,
path: '/upload',
method: 'GET'
};
var req = http.request(options, function(res) {
console.log('STATUS: ' + res.statusCode);
console.log('HEADERS: ' + JSON.stringify(res.headers));
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log('BODY: ' + chunk);
});
});
req.end();
Request hangs forever. I had a problem with node 0.4.5, before I had it with 0.4.2. This has serious consequences, for example, npm does not work at all. I run node in 2010 Mac Book Pro 15 "and has os 10.6.7, just like 2 peers connected to the same Wi-Fi router. Does anyone have an idea of ββwhat is happening? Any chance of conflict with any other application or service running on my machine.
source
share