The problem in your code is that the "end" event never fires because you are using the Stream2 request stream as if it were Stream1. Read the migration tutorial - http://blog.nodejs.org/2012/12/20/streams2/
To convert it to "old mode behavior", you can add an event handler "data" or ".resume ()":
var http = require('http'); http.createServer(function (request, response) { request.resume(); request.on('end', function() { response.writeHead(200, { 'Content-Type' : 'text/plain' }); response.end('Hello HTTP!'); }); }).listen(8080);
If your example is an HTTP GET handler, you already have all the headers and don't have to wait for the body:
var http = require('http'); http.createServer(function (request, response) { response.writeHead(200, { 'Content-Type' : 'text/plain' }); response.end('Hello HTTP!'); }).listen(8080);
source share