// streams1 // works in node v0.6.21 // works in node v0.10.29 (latest stable) // Tested with `curl -d 'akshdakjhdakjhsdkajhdjkahdsjka' http://localhost:8080` var http = require('http'); http.createServer(function(req, res) { console.log('Got Request'); res.writeHead(200); req.on('data', function(chunk){ console.log('got %d bytes of data', chunk.length); }); req.on('end', function() { res.end('over'); }); }).listen(8080);