Mercurial > hg > rlgwebd
comparison rlgwebd.js @ 30:b5570a594266
rlgwebd.js: listen on any address
The RLG-Web server now binds to any address instead of 127.0.0.1 only.
author | John "Elwin" Edwards <elwin@sdf.org> |
---|---|
date | Tue, 05 Jun 2012 09:22:17 -0700 |
parents | cf9d294bc52f |
children | 7dd6becf9ce9 |
comparison
equal
deleted
inserted
replaced
29:cf9d294bc52f | 30:b5570a594266 |
---|---|
8 var path = require('path'); | 8 var path = require('path'); |
9 var fs = require('fs'); | 9 var fs = require('fs'); |
10 var child_process = require('child_process'); | 10 var child_process = require('child_process'); |
11 var daemon = require(path.join(localModules, "daemon")); | 11 var daemon = require(path.join(localModules, "daemon")); |
12 | 12 |
13 /* Configuration variables */ | |
13 // These first two files are NOT in the chroot. | 14 // These first two files are NOT in the chroot. |
14 var ctlsocket = "/var/local/rlgwebd/ctl"; | 15 var ctlsocket = "/var/local/rlgwebd/ctl"; |
15 var logfile = "/var/local/rlgwebd/log"; | 16 var logfile = "/var/local/rlgwebd/log"; |
17 var httpPort = 8080; | |
16 var chrootDir = "/var/dgl/"; | 18 var chrootDir = "/var/dgl/"; |
17 var dropToUID = 501; | 19 var dropToUID = 501; |
18 var dropToGID = 501; | 20 var dropToGID = 501; |
19 var serveStaticRoot = "/var/www/"; // inside the chroot | 21 var serveStaticRoot = "/var/www/"; // inside the chroot |
20 var passwdfile = "/dgldir/dgl-login"; | 22 var passwdfile = "/dgldir/dgl-login"; |
23 | |
24 /* Global state */ | |
21 var sessions = {}; | 25 var sessions = {}; |
22 var allowlogin = true; | 26 var allowlogin = true; |
23 | 27 |
24 var games = { | 28 var games = { |
25 "rogue3": { | 29 "rogue3": { |
720 catch (err) { | 724 catch (err) { |
721 tslog("Could not drop permissions: %s", err); | 725 tslog("Could not drop permissions: %s", err); |
722 process.exit(1); | 726 process.exit(1); |
723 } | 727 } |
724 httpServer = http.createServer(webHandler); | 728 httpServer = http.createServer(webHandler); |
725 httpServer.listen(8080, "127.0.0.1"); | 729 httpServer.listen(httpPort); |
726 tslog('rlgwebd running at http://127.0.0.1:8080/'); | 730 tslog('rlgwebd running on port %d', httpPort); |
727 }); | 731 }); |
728 | 732 |