This commit is contained in:
Mikeal Rogers authored and Ryan Dahl committed 2011-08-22 14:31:25 -07:00
1 parent 94963ab39a
commit 103990b640
2 files changed
+18 -7

No files matched your search

+7 -4
View File
@@ -51,12 +51,14 @@ exports.createServer = function(opts, requestListener) {
// HTTPS agents.
function createConnection(port, host, options) {
return tls.connect(port, host, options);
};
function Agent(options) {
http.Agent.call(this, options);
this.createConnection = function(port, host) {
return tls.connect(port, host, options);
};
}
this.createConnection = createConnection;
};
inherits(Agent, http.Agent);
Agent.prototype.defaultPort = 443;
@@ -69,6 +71,7 @@ exports.request = function(options, cb) {
if (options.agent === undefined) {
options.agent = globalAgent;
}
options.createConnection = createConnection;
options.defaultPort = options.defaultPort || 443;
return http.request(options, cb);
};