mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-05 14:10:26 +00:00
serve: avoid fake socket listener port
This commit is contained in:
parent
3caba56bd9
commit
91d148d95f
1 changed files with 3 additions and 3 deletions
|
|
@ -119,7 +119,7 @@ const listenEffect: (opts: ListenOptions) => Effect.Effect<EffectListener, unkno
|
|||
function* (opts: ListenOptions) {
|
||||
const state = yield* startWithPortFallback(opts)
|
||||
if (opts.type === "socket") {
|
||||
const listenerUrl = makeURL("localhost", 0)
|
||||
const listenerUrl = makeURL("localhost")
|
||||
url = listenerUrl
|
||||
|
||||
return {
|
||||
|
|
@ -194,10 +194,10 @@ function tcpAddress(state: ListenerState) {
|
|||
})
|
||||
}
|
||||
|
||||
function makeURL(hostname: string, port: number) {
|
||||
function makeURL(hostname: string, port?: number) {
|
||||
const result = new URL("http://localhost")
|
||||
result.hostname = hostname
|
||||
result.port = String(port)
|
||||
if (port !== undefined) result.port = String(port)
|
||||
return result
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue