Created
April 2, 2013 17:01
-
-
Save eveiga/5293995 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var server = http.createServer(); | |
server.listen(8000); | |
server.on('request', function(req, res) { | |
http.get("http://google.com/index.html", function(response) { | |
req.on("end", function() { | |
console.log("ENDED"); | |
}); | |
}); | |
}); |
Nice to know Isaacs. Thanks for the tip
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In v0.10, this is quite different!
Because stream
'end'
doesn't happen until you consume the request, it actually hasn't happened yet.So, instead of missing the
'end'
like you would on v0.8, it's hanging waiting for you to consume the stream, because it starts out paused until you consume it.