mirror of
https://github.com/thelounge/thelounge
synced 2024-11-21 19:43:07 +00:00
parent
a53169627e
commit
b79a6cce0c
2 changed files with 25 additions and 11 deletions
|
@ -16,6 +16,8 @@ module.exports = {
|
|||
// IP address or hostname for the web server to listen on.
|
||||
// Setting this to undefined will listen on all interfaces.
|
||||
//
|
||||
// For UNIX domain sockets, use unix:/absolute/path/to/file.sock.
|
||||
//
|
||||
// @type string
|
||||
// @default undefined
|
||||
//
|
||||
|
|
|
@ -83,18 +83,30 @@ module.exports = function() {
|
|||
}, app);
|
||||
}
|
||||
|
||||
server.listen({
|
||||
port: config.port,
|
||||
host: config.host,
|
||||
}, () => {
|
||||
const protocol = config.https.enable ? "https" : "http";
|
||||
var address = server.address();
|
||||
let listenParams;
|
||||
|
||||
log.info(
|
||||
"Available at " +
|
||||
colors.green(`${protocol}://${address.address}:${address.port}/`) +
|
||||
` in ${colors.bold(config.public ? "public" : "private")} mode`
|
||||
);
|
||||
if (typeof config.host === "string" && config.host.startsWith("unix:")) {
|
||||
listenParams = config.host.replace(/^unix:/, "");
|
||||
} else {
|
||||
listenParams = {
|
||||
port: config.port,
|
||||
host: config.host,
|
||||
};
|
||||
}
|
||||
|
||||
server.listen(listenParams, () => {
|
||||
if (typeof listenParams === "string") {
|
||||
log.info("Available on socket " + colors.green(listenParams));
|
||||
} else {
|
||||
const protocol = config.https.enable ? "https" : "http";
|
||||
const address = server.address();
|
||||
|
||||
log.info(
|
||||
"Available at " +
|
||||
colors.green(`${protocol}://${address.address}:${address.port}/`) +
|
||||
` in ${colors.bold(config.public ? "public" : "private")} mode`
|
||||
);
|
||||
}
|
||||
|
||||
const sockets = io(server, {
|
||||
serveClient: false,
|
||||
|
|
Loading…
Reference in a new issue