forked from coolaj86/goldilocks.js
specifying insecurePort
This commit is contained in:
parent
24250f82d8
commit
ed47fb80b5
|
@ -177,15 +177,23 @@ function createServer(port, pubdir, content, opts) {
|
||||||
server2.watch(pubdir);
|
server2.watch(pubdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('false' !== opts.insecurePort && httpPort === opts.insecurePort) {
|
// if we haven't disabled insecure port
|
||||||
return createInsecureServer(opts.insecurePort, pubdir, opts).then(function (_server) {
|
if ('false' === opts.insecurePort) {
|
||||||
insecureServer = _server;
|
// and both ports are the default
|
||||||
resolve();
|
if ((httpsPort === opts.port && httpPort === opts.insecurePort)
|
||||||
});
|
// or other case
|
||||||
} else {
|
|| (httpPort !== opts.insecurePort && opts.port !== opts.insecurePort)
|
||||||
opts.insecurePort = opts.port;
|
) {
|
||||||
resolve();
|
return createInsecureServer(opts.insecurePort, pubdir, opts).then(function (_server) {
|
||||||
|
insecureServer = _server;
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts.insecurePort = opts.port;
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
});
|
});
|
||||||
|
|
||||||
if ('function' === typeof app) {
|
if ('function' === typeof app) {
|
||||||
|
|
Loading…
Reference in New Issue