mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-07 09:18:41 +00:00
fix: mdns discover hostname (#9039)
This commit is contained in:
@@ -7,15 +7,17 @@ export namespace MDNS {
|
||||
let bonjour: Bonjour | undefined
|
||||
let currentPort: number | undefined
|
||||
|
||||
export function publish(port: number, name = "opencode") {
|
||||
export function publish(port: number) {
|
||||
if (currentPort === port) return
|
||||
if (bonjour) unpublish()
|
||||
|
||||
try {
|
||||
const name = `opencode-${port}`
|
||||
bonjour = new Bonjour()
|
||||
const service = bonjour.publish({
|
||||
name,
|
||||
type: "http",
|
||||
host: "opencode.local",
|
||||
port,
|
||||
txt: { path: "/" },
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user