diff --git a/server/Server.js b/server/Server.js index 0e53d3e9..ef6ecb8a 100644 --- a/server/Server.js +++ b/server/Server.js @@ -395,10 +395,19 @@ class Server { }) router.get('/healthcheck', (req, res) => res.sendStatus(200)) - this.server.listen(this.Port, this.Host, () => { - if (this.Host) Logger.info(`Listening on http://${this.Host}:${this.Port}`) - else Logger.info(`Listening on port :${this.Port}`) - }) + const unixSocketPrefix = 'unix/' + if (this.Host?.startsWith(unixSocketPrefix)) { + const sockPath = this.Host.slice(unixSocketPrefix.length) + this.server.listen(sockPath, async () => { + await fs.chmod(sockPath, 0o666) + Logger.info(`Listening on unix socket ${sockPath}`) + }) + } else { + this.server.listen(this.Port, this.Host, () => { + if (this.Host) Logger.info(`Listening on http://${this.Host}:${this.Port}`) + else Logger.info(`Listening on port :${this.Port}`) + }) + } // Start listening for socket connections SocketAuthority.initialize(this)