Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

create-servers

Package Overview
Dependencies
Maintainers
4
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-servers - npm Package Compare versions

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();
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc