mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
http/https: pass request to .createConnection()
It's useful for passing some additional options of request object to the underlying API
This commit is contained in:
11
lib/https.js
11
lib/https.js
@@ -21,7 +21,8 @@
|
||||
|
||||
var tls = require('tls');
|
||||
var http = require('http');
|
||||
var inherits = require('util').inherits;
|
||||
var util = require('util');
|
||||
var inherits = util.inherits;
|
||||
|
||||
function Server(opts, requestListener) {
|
||||
if (!(this instanceof Server)) return new Server(opts, requestListener);
|
||||
@@ -52,15 +53,15 @@ exports.createServer = function(opts, requestListener) {
|
||||
// HTTPS agents.
|
||||
|
||||
function createConnection(/* [port, host, options] */) {
|
||||
var options = {};
|
||||
var options = util._extend({}, this.options);
|
||||
|
||||
if (typeof arguments[0] === 'object') {
|
||||
options = arguments[0];
|
||||
options = util._extend(options, arguments[0]);
|
||||
} else if (typeof arguments[1] === 'object') {
|
||||
options = arguments[1];
|
||||
options = util._extend(options, arguments[1]);
|
||||
options.port = arguments[0];
|
||||
} else if (typeof arguments[2] === 'object') {
|
||||
options = arguments[2];
|
||||
options = util._extend(options, arguments[2]);
|
||||
options.port = arguments[0];
|
||||
options.host = arguments[1];
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user