Skip to content

Instantly share code, notes, and snippets.

@arisolt
Created January 31, 2013 22:43
Show Gist options
  • Save arisolt/4687366 to your computer and use it in GitHub Desktop.
Save arisolt/4687366 to your computer and use it in GitHub Desktop.
var request = require('request');
httprequest({
headers: {
connection: 'keep-alive'
},
'pool.maxSockets': 1, //hopefully will make Node to reuse the connection next time it connects to the same host (instead of creating a new connection)
url: "http://www.google.com"}, function (error, response, body) {
console.log('');
httprequest({
headers: {
connection: 'keep-alive'
},
url: "http://www.google.com"}, function (error, response, body) {
console.log('');
});
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment