Created
January 31, 2013 22:43
-
-
Save arisolt/4687366 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 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