summaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
authorChristoph (Sheogorath) Kern2018-07-27 14:40:41 +0200
committerGitHub2018-07-27 14:40:41 +0200
commita6a15e09fe2b3074daa200fe7768e39c20623b9b (patch)
tree9882e2b2bd2a61d7fca1716c2f59fcb3fea78860 /app.js
parent53a846bdc56b5b108825451c3c248aead2712e97 (diff)
parent70e8df5c04274ac4ee9d3eb2462fed12a85f6ccd (diff)
Merge pull request #902 from ahihi/listen-address-options
Support 'host' & 'path' config options
Diffstat (limited to 'app.js')
-rw-r--r--app.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/app.js b/app.js
index e2479137..24f0516f 100644
--- a/app.js
+++ b/app.js
@@ -205,11 +205,21 @@ io.sockets.on('connection', realtime.connection)
// listen
function startListen () {
- server.listen(config.port, function () {
+ var address
+ var listenCallback = function () {
var schema = config.useSSL ? 'HTTPS' : 'HTTP'
- logger.info('%s Server listening at port %d', schema, config.port)
+ logger.info('%s Server listening at %s', schema, address)
realtime.maintenance = false
- })
+ }
+
+ // use unix domain socket if 'path' is specified
+ if (config.path) {
+ address = config.path
+ server.listen(config.path, listenCallback)
+ } else {
+ address = config.host + ':' + config.port
+ server.listen(config.port, config.host, listenCallback)
+ }
}
// sync db then start listen