File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ export const WebCommand = cmd({
6060 }
6161
6262 if ( opts . mdns ) {
63- UI . println ( UI . Style . TEXT_INFO_BOLD + " mDNS: " , UI . Style . TEXT_NORMAL , " opencode.local" )
63+ UI . println ( UI . Style . TEXT_INFO_BOLD + " mDNS: " , UI . Style . TEXT_NORMAL , ` opencode.local: ${ server . port } ` )
6464 }
6565
6666 // Open localhost in browser
Original file line number Diff line number Diff line change @@ -7,15 +7,17 @@ export namespace MDNS {
77 let bonjour : Bonjour | undefined
88 let currentPort : number | undefined
99
10- export function publish ( port : number , name = "opencode" ) {
10+ export function publish ( port : number ) {
1111 if ( currentPort === port ) return
1212 if ( bonjour ) unpublish ( )
1313
1414 try {
15+ const name = `opencode-${ port } `
1516 bonjour = new Bonjour ( )
1617 const service = bonjour . publish ( {
1718 name,
1819 type : "http" ,
20+ host : "opencode.local" ,
1921 port,
2022 txt : { path : "/" } ,
2123 } )
Original file line number Diff line number Diff line change @@ -562,7 +562,7 @@ export namespace Server {
562562 opts . hostname !== "localhost" &&
563563 opts . hostname !== "::1"
564564 if ( shouldPublishMDNS ) {
565- MDNS . publish ( server . port ! , `opencode- ${ server . port ! } ` )
565+ MDNS . publish ( server . port ! )
566566 } else if ( opts . mdns ) {
567567 log . warn ( "mDNS enabled but hostname is loopback; skipping mDNS publish" )
568568 }
You can’t perform that action at this time.
0 commit comments