This code works for me in Node 0.10, but it doesn't print anything at 0.8
var http = require('http'); var req = http.request('http://www.google.com:80', function(res) { setTimeout(function() { res.pipe(process.stdout); }, 0); }); req.end();
After some guessing, I found a workaround:
var http = require('http'); var req = http.request('http://www.google.com:80', function(res) { res.pause(); setTimeout(function() { res.resume(); res.pipe(process.stdout); }, 0); }); req.end();
But the documentation says the pause is advisory, and that bothers me. Why should I pause a thread that is not connected anywhere?
source share