Skip to content

Instantly share code, notes, and snippets.

@lxe
Created December 14, 2014 02:25
Show Gist options
  • Select an option

  • Save lxe/8b6ae61b8ce3f1e180fc to your computer and use it in GitHub Desktop.

Select an option

Save lxe/8b6ae61b8ce3f1e180fc to your computer and use it in GitHub Desktop.
var http = require('http');
var bl = require('bl');
var server = http.createServer(function (req, res) {
res.end('OK');
}).listen(3000);
http.request('http://localhost:3000/')
.on('response', function onResponse(response) {
response.pipe(bl(function (err, data) {
console.log(err, data);
}));
})
.end();
console.log(process._getActiveHandles().map(function (h) {
return h.constructor.name;
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment