javascript - Troubleshooting Error: connect ECONNREFUSED in nodejs stream-adventure tutorial -


i've been working through learnyoujs , stream-adventure tutorials:

https://github.com/substack/stream-adventure

https://github.com/rvagg/learnyounode#learn-you-the-nodejs-for-much-win

i've gotten way through first set , of way thorough second, keep getting odd error... can go away.

here's command/error:

dev/javascript/streamadventure » stream-adventure run httpserver.js

stream.js:94   throw er; // unhandled stream error in pipe.         ^ error: connect econnrefused   @ errnoexception (net.js:901:11)   @ object.afterconnect [as oncomplete] (net.js:892:19) 

this launch not kill process node, ps aux | grep node , find process , kill it.

here's "working" code tutorial:

var http = require('http'); var through = require('through');  var server = http.createserver(function (req, res) {     if (req.method === 'post') {         req.pipe(through(function (buf) {             this.queue(buf.tostring().touppercase());         })).pipe(res);     }     else res.end('send me post\n'); }); server.listen(8000); 

if run nod httpserver.js , curl @ it, works fine.... have insight causing error?

there pull request fix this, here: https://github.com/substack/stream-adventure/pull/16

try listen on port 8001 instead , rerun verify after closing processes listening on 8000.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -