mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
refactor(server) start
This commit is contained in:
parent
6eaadb195f
commit
6e88653fb5
1 changed files with 4 additions and 4 deletions
|
|
@ -52,7 +52,7 @@
|
|||
* @param pProcessing {index, appcache, rest}
|
||||
*/
|
||||
function start(options) {
|
||||
var redirectServer, port, ip, isSSL, sslPort,
|
||||
var redirectServer, port, ip, ssl, sslPort,
|
||||
sockets, httpServer, serverLog,
|
||||
HTTP = 'http://',
|
||||
HTTPS = 'https://',
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
config.ip ||
|
||||
(main.WIN32 ? '127.0.0.1' : '0.0.0.0'),
|
||||
|
||||
isSSL = options.ssl,
|
||||
ssl = options.ssl,
|
||||
sslPort = config.sslPort,
|
||||
|
||||
sockets = function(pServer) {
|
||||
|
|
@ -137,9 +137,9 @@
|
|||
|
||||
redirectServer.listen(port, ip);
|
||||
|
||||
Server = https.createServer(lSSL, respond);
|
||||
Server = https.createServer(ssl, respond);
|
||||
Server.on('error', function (error) {
|
||||
Util.log(error, '\nCould not use https port: ' + lSSLPort);
|
||||
Util.log(error, '\nCould not use https port: ' + sslPort);
|
||||
redirectServer.close();
|
||||
Util.log('* Redirection http -> https removed');
|
||||
httpServer();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue