Merge pull request #4595 from renesat/fix/listening-ipv6-url

Fix listening url log with ipv6 host
This commit is contained in:
advplyr 2025-08-20 18:45:04 -04:00 committed by GitHub
commit 3911a7273b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,7 +420,7 @@ class Server {
})
} else {
this.server.listen(this.Port, this.Host, () => {
if (this.Host) Logger.info(`Listening on http://${this.Host}:${this.Port}`)
if (this.Host) Logger.info(`Listening on http://${is.ipv6(this.Host) ? `[${this.Host}]` : this.Host}:${this.Port}`)
else Logger.info(`Listening on port :${this.Port}`)
})
}