Error connect ECONNREFUSED

I'm getting this error and unable to fix this.

events.js:72

 throw er; // Unhandled 'error' event
          ^

Error: connect ECONNREFUSED at errnoException (net.js:901:11) at Object.afterConnect [as oncomplete] (net.js:892:19)

var http = require('http');


var options = {
host: 'localhost',
port: '8081',
path: '/index.htm'  
};


 var callback = function(response){

 var body = '';
 response.on('data', function(data) {
   body += data;
});

response.on('end', function() {

  console.log(body);
 });

 }

var req = http.request(options, callback);
req.end();
链接地址: http://www.djcxy.com/p/87252.html

上一篇: https.request错误:连接ECONNREFUSED

下一篇: 错误连接ECONNREFUSED