feat(server): add --mdns-domain flag to customize mDNS hostname (#11796)

This commit is contained in:
Luiz Guilherme D'Abruzzo Pereira
2026-02-02 17:52:32 -03:00
committed by GitHub
parent 824165eb79
commit a9fca05d8b
5 changed files with 21 additions and 6 deletions

View File

@@ -563,7 +563,13 @@ export namespace Server {
return result
}
export function listen(opts: { port: number; hostname: string; mdns?: boolean; cors?: string[] }) {
export function listen(opts: {
port: number
hostname: string
mdns?: boolean
mdnsDomain?: string
cors?: string[]
}) {
_corsWhitelist = opts.cors ?? []
const args = {
@@ -591,7 +597,7 @@ export namespace Server {
opts.hostname !== "localhost" &&
opts.hostname !== "::1"
if (shouldPublishMDNS) {
MDNS.publish(server.port!)
MDNS.publish(server.port!, opts.mdnsDomain)
} else if (opts.mdns) {
log.warn("mDNS enabled but hostname is loopback; skipping mDNS publish")
}