# HG changeset patch # User John "Elwin" Edwards # Date 1483910231 18000 # Node ID a200b313870d62e806bf5497b5a32ee410182225 # Parent 5491ca3a335bad09b40e8d786526fbd597c51fb8 Use either HTTP or HTTPS. If HTTPS is enabled, RLGWebD will not use insecure HTTP. diff -r 5491ca3a335b -r a200b313870d rlgwebd --- a/rlgwebd Wed Jan 04 21:25:43 2017 -0500 +++ b/rlgwebd Sun Jan 08 16:17:11 2017 -0500 @@ -16,8 +16,7 @@ /* Default options */ var rlgwebd_options = { control_socket: "/var/run/rlgwebd.sock", - http_port: 8080, - https_port: 8081, + port: 8080, chrootDir: "/var/dgl/", username: "rodney", static_root: "/var/www/" @@ -1288,20 +1287,22 @@ tslog("Could not drop permissions: %s", err); process.exit(1); } - httpServer = http.createServer(webHandler); - httpServer.listen(rlgwebd_options.http_port); - tslog('rlgwebd running on port %d', rlgwebd_options.http_port); - wsServer = new WebSocketServer({"httpServer": httpServer}); - wsServer.on("request", wsHandler); - tslog('WebSockets are online'); if (rlgwebd_options.use_https) { - var httpsServer = https.createServer(tls_options, webHandler); - httpsServer.listen(rlgwebd_options.https_port); - tslog('TLS running on port %d', rlgwebd_options.https_port); - var wssServer = new WebSocketServer({"httpServer": httpsServer}); - wssServer.on("request", wsHandler); + httpServer = https.createServer(tls_options, webHandler); + httpServer.listen(rlgwebd_options.port); + tslog('rlgwebd running on port %d (TLS)', rlgwebd_options.port); + wsServer = new WebSocketServer({"httpServer": httpServer}); + wsServer.on("request", wsHandler); tslog('Secure WebSockets are online'); } + else { + httpServer = http.createServer(webHandler); + httpServer.listen(rlgwebd_options.port); + tslog('rlgwebd running on port %d', rlgwebd_options.port); + wsServer = new WebSocketServer({"httpServer": httpServer}); + wsServer.on("request", wsHandler); + tslog('WebSockets are online'); + } progressWatcher = startProgressWatcher(); setInterval(pushStatus, 40000); }); diff -r 5491ca3a335b -r a200b313870d rlgwebd.conf --- a/rlgwebd.conf Wed Jan 04 21:25:43 2017 -0500 +++ b/rlgwebd.conf Sun Jan 08 16:17:11 2017 -0500 @@ -5,9 +5,7 @@ # Location of the socket for start/stop commands #control_socket = /var/run/rlgwebd.sock # Port number to bind -#http_port = 8080 -# Port number for HTTPS -#https_port = 8081 +#port = 8080 # Path to the dgamelaunch installation to chroot into # If you change this, change the Makefile too #chrootDir = /var/dgl/