diff --git a/lib/http2.js b/lib/http2.js index bc87442f64f..36b81ec2c74 100644 --- a/lib/http2.js +++ b/lib/http2.js @@ -1259,6 +1259,7 @@ exports.request = function(options, cb) { if (options.agent === undefined) { options.agent = globalAgent; } + options.defaultPort = options.defaultPort || 80; return new ClientRequest(options, cb); }; diff --git a/lib/https2.js b/lib/https2.js index c1c9b7109b7..02f32897b60 100644 --- a/lib/https2.js +++ b/lib/https2.js @@ -69,6 +69,7 @@ exports.request = function(options, cb) { if (options.agent === undefined) { options.agent = globalAgent; } + options.defaultPort = options.defaultPort || 443; return http.request(options, cb); };