Node.js ECONNRESET错误

我试了下面的代码在Windows 7和Mac雪豹,我收到了同样的错误与Node.js 0.12.0

我有其他端口号,我已经尝试使用'localhost'而不是'127.0.0.1'。 我有我的主机文件在C:\ Windows \ System32下的IP。 我在这里感到茫然,但行为是一致的,我在网上看到很多喋喋不休,没有真正的答案或解决scheme,但人们在这里得到坚实的答案。

来自Node.js命令提示符的响应

{ [Error: connect ECONNREFUSED] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect' } { [Error: socket hang up] code: 'ECONNRESET' } 

 var http = require('http'); var makeRequest = function(message) { var options = { host: '127.0.0.1', port: 8080, path: '/', method: 'POST', headers: { 'Content-Type': 'application/text', 'Content-Length': message.length } } var request = http.request(options, function(response) { response.on('data', function(data) { console.log(data); }); }); process.on('uncaughtException', function (err) { console.log(err); }); request.write(message); request.end(); } makeRequest('Hi!!!!');