specifying insecurePort

This commit is contained in:
AJ ONeal 2016-10-27 02:44:14 -06:00
parent 24250f82d8
commit ed47fb80b5
1 changed files with 16 additions and 8 deletions

View File

@ -177,15 +177,23 @@ function createServer(port, pubdir, content, opts) {
server2.watch(pubdir);
}
if ('false' !== opts.insecurePort && httpPort === opts.insecurePort) {
return createInsecureServer(opts.insecurePort, pubdir, opts).then(function (_server) {
insecureServer = _server;
resolve();
});
} else {
opts.insecurePort = opts.port;
resolve();
// if we haven't disabled insecure port
if ('false' === opts.insecurePort) {
// and both ports are the default
if ((httpsPort === opts.port && httpPort === opts.insecurePort)
// or other case
|| (httpPort !== opts.insecurePort && opts.port !== opts.insecurePort)
) {
return createInsecureServer(opts.insecurePort, pubdir, opts).then(function (_server) {
insecureServer = _server;
resolve();
});
}
}
opts.insecurePort = opts.port;
resolve();
return;
});
if ('function' === typeof app) {