Skip to content

Instantly share code, notes, and snippets.

@daguej
Created January 22, 2016 00:50
Show Gist options
  • Save daguej/13a712bdf2db1a23862f to your computer and use it in GitHub Desktop.
Save daguej/13a712bdf2db1a23862f to your computer and use it in GitHub Desktop.
request leak test
var request = require('request'),
fs = require('fs');
request({
url: 'http://localhost:5555/r/' + process.argv[2]
}, function(err, res, body) {
console.log(err, res && res.statusCode, body);
});
var express = require('express'),
app = express();
app.get('/r/:n', function(req, res) {
var n = parseInt(req.params.n);
setTimeout(function() {
if (n < 15) {
res.redirect('/r/' + (n+1));
} else {
res.send('ok');
}
}, 100);
});
app.listen(5555);
@daguej
Copy link
Author

daguej commented Jan 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment