Created
December 14, 2014 02:25
-
-
Save lxe/8b6ae61b8ce3f1e180fc to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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