From 553ffd1934d16be7a3ba624d1204d9eaf327bd47 Mon Sep 17 00:00:00 2001 From: renesat Date: Sat, 16 Aug 2025 18:22:57 +0200 Subject: [PATCH] Fix listening url log with ipv6 host --- server/Server.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/Server.js b/server/Server.js index 457aa61a..719d4c29 100644 --- a/server/Server.js +++ b/server/Server.js @@ -11,6 +11,7 @@ const axios = require('axios') const { version } = require('../package.json') // Utils +const is = require('./libs/requestIp/isJs') const fileUtils = require('./utils/fileUtils') const { toNumber } = require('./utils/index') const Logger = require('./Logger') @@ -419,8 +420,13 @@ class Server { }) } 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}`) + if (this.Host) { + let host = this.Host + if (is.ipv6(host)) { + host = '[' + host + ']' + } + Logger.info(`Listening on http://${host}:${this.Port}`) + } else Logger.info(`Listening on port :${this.Port}`) }) }