Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions server/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading