create-servers
Advanced tools
Comparing version 1.5.0 to 2.0.0
18
index.js
@@ -49,4 +49,3 @@ 'use strict'; | ||
errors = {}, | ||
servers = {}, | ||
errState; | ||
servers = {}; | ||
@@ -76,3 +75,3 @@ // | ||
https: errors.https, | ||
http: errors.http, | ||
http: errors.http | ||
}), servers); | ||
@@ -106,8 +105,7 @@ } | ||
port = options.http.port || 80, | ||
args, | ||
ip; | ||
args; | ||
args = [server, port]; | ||
if (ip === options.http.ip) { | ||
args.push(ip); | ||
if (options.http.host) { | ||
args.push(options.http.host); | ||
} | ||
@@ -166,3 +164,3 @@ | ||
ciphers: ssl.ciphers, | ||
honorCipherOrder: ssl.honorCipherOrder === false ? false : true, | ||
honorCipherOrder: !!ssl.honorCipherOrder, | ||
// | ||
@@ -181,4 +179,4 @@ // Optionally support SNI-based SSL. | ||
args = [server, port]; | ||
if (ip === options.https.ip) { | ||
args.push(ip); | ||
if (options.https.host) { | ||
args.push(options.https.host); | ||
} | ||
@@ -185,0 +183,0 @@ |
{ | ||
"name": "create-servers", | ||
"version": "1.5.0", | ||
"version": "2.0.0", | ||
"description": "Create an http AND/OR an https server and call the same request handler.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -131,3 +131,3 @@ /* | ||
log: console.log, | ||
http: "9876", | ||
http: '9876', | ||
handler: fend | ||
@@ -142,2 +142,22 @@ }, function (err, servers) { | ||
}); | ||
test('host can be provided to the server', function (t) { | ||
t.plan(4); | ||
createServers({ | ||
log: console.log, | ||
http: { | ||
port: 9877, | ||
host: '127.0.0.1' | ||
}, | ||
handler: fend | ||
}, function (err, servers) { | ||
console.dir(err); | ||
t.error(err); | ||
t.equals(typeof servers, 'object'); | ||
t.equals(typeof servers.http, 'object'); | ||
t.equals(servers.http.address().address, '127.0.0.1'); | ||
servers.http.close(); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15501
313
4