Node.js Error : connect ECONN Refused

I am new to Node.js and am unable to resolve this error:

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

The code I was trying out follows :

    var async = require('async'),
    request = require('request');

function done(err,results) {
    if (err) {
        throw err;
    }

    console.log('Done ! results: %j',results);
}


var collection = [1,2,3,4];

function iterator(value,callback) {
    request.post({
        url: 'http://localhost:8080',
        body: JSON.stringify(value)
    }, function (err,res,body){
        if (err) {
            callback(err,body && JSON.parse(body));
        }

    });
}

async.map(collection,iterator,done);
链接地址: http://www.djcxy.com/p/87242.html

上一篇: 在NODEJS中连接ECONNREFUSED

下一篇: Node.js错误:连接ECONN拒绝