Skip to content

Instantly share code, notes, and snippets.

@sang4lv
Created August 29, 2013 04:29
Show Gist options
  • Save sang4lv/6374287 to your computer and use it in GitHub Desktop.
Save sang4lv/6374287 to your computer and use it in GitHub Desktop.
rewrite needed
var http = require('http');
function response(res, cb) {
var buffer = '';
res.on('data', function(chunk) {
buffer += chunk.toString();
});
res.on('end', function(){
console.log(buffer);
});
cb();
}
var stream = http.get(process.argv[2], function(res) {
response(res, function() {
http.get(process.argv[3], function(res) {
response(res, function() {
http.get(process.argv[4], function(res) {
response(res, function() {});
});
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment