// streams2 // works in v0.10.29 // does not work in v.0.6.21 // Example taken from http://nodejs.org/api/stream.html#stream_class_stream_readable // Tested with `curl -d 'akshdakjhdakjhsdkajhdjkahdsjka' http://localhost:8080` var http = require('http'); http.createServer(function(req, res) { console.log('Got Request'); req.on('readable', function() { var chunk = null; while (null !== (chunk = req.read())) { console.log('got %d bytes of data', chunk.length); } }); req.on('end', function() { res.end('Done'); }); }).listen(8080);