# HG changeset patch
# User John "Elwin" Edwards <elwin@sdf.org>
# Date 1338913337 25200
# Node ID b5570a594266e74364ae0fb34ddfd58c072a9463
# Parent cf9d294bc52f47eb37d7a0d729b65e36d4e0e341
rlgwebd.js: listen on any address
The RLG-Web server now binds to any address instead of 127.0.0.1 only.
diff -r cf9d294bc52f -r b5570a594266 rlgwebd.js
--- a/rlgwebd.js Mon Jun 04 21:34:57 2012 -0700
+++ b/rlgwebd.js Tue Jun 05 09:22:17 2012 -0700
@@ -10,14 +10,18 @@
var child_process = require('child_process');
var daemon = require(path.join(localModules, "daemon"));
+/* Configuration variables */
// These first two files are NOT in the chroot.
var ctlsocket = "/var/local/rlgwebd/ctl";
var logfile = "/var/local/rlgwebd/log";
+var httpPort = 8080;
var chrootDir = "/var/dgl/";
var dropToUID = 501;
var dropToGID = 501;
var serveStaticRoot = "/var/www/"; // inside the chroot
var passwdfile = "/dgldir/dgl-login";
+
+/* Global state */
var sessions = {};
var allowlogin = true;
@@ -722,7 +726,7 @@
process.exit(1);
}
httpServer = http.createServer(webHandler);
- httpServer.listen(8080, "127.0.0.1");
- tslog('rlgwebd running at http://127.0.0.1:8080/');
+ httpServer.listen(httpPort);
+ tslog('rlgwebd running on port %d', httpPort);
});