Skip to content

Instantly share code, notes, and snippets.

@boopathi
Created February 18, 2014 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boopathi/9068567 to your computer and use it in GitHub Desktop.
Save boopathi/9068567 to your computer and use it in GitHub Desktop.
A bug with node.js HTTP. Cannot send more than 5 HTTP requests with Node.
var http = require("http");
function inf(i) {
var req = http.request({
method: "GET",
path: "/",
host: "www.google.com",
port: 80
},function() {
console.log(i,"Response received");
inf(i+1);
});
req.on('error', function() {
console.log(i,"Error Received");
inf(i+1);
});
req.end();
}
inf(0);
@boopathi
Copy link
Author

boopathi commented Mar 7, 2014

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