Skip to content

Instantly share code, notes, and snippets.

@russellhaering
Created August 26, 2010 03:25
Show Gist options
  • Save russellhaering/550726 to your computer and use it in GitHub Desktop.
Save russellhaering/550726 to your computer and use it in GitHub Desktop.
var http = require('http');
var client = http.createClient(8124);
var request;
for (var i = 0; i < 10; i++) {
request = client.request('GET', '/', {'host': 'localhost'});
request.end();
console.log("Request sent");
}
var http = require('http');
http.createServer(function (request, response) {
console.log("Request received");
setTimeout(function() {
console.log("Response sent");
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World\n');
}, 1000);
}).listen(8124);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment