mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
Fixes #1531
This commit is contained in:
1 parent
94963ab39a
commit
103990b640
2 files changed
+18
-7
No files matched your search
+7
-4
@@ -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);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user