Expose agent in http and https client.

This commit is contained in:
Mikeal Rogers
2011-01-22 16:09:50 -08:00
committed by Ryan Dahl
parent 7892918353
commit 8d37f80f4b
2 changed files with 15 additions and 6 deletions

View File

@@ -59,8 +59,12 @@ exports.getAgent = getAgent;
exports.request = function(options, cb) {
var agent = getAgent(options);
return http._requestFromAgent(agent, options, cb);
if (options.agent === undefined) {
options.agent = getAgent(options);
} else if (options.agent === false) {
options.agent = new Agent(options);
}
return http._requestFromAgent(options, cb);
};