feat: automatic mixed port fallback (#7579)

* feat: automatically select an available mixed proxy port

* fix: coordinate listener port changes

* fix: detect Windows listener port conflicts
This commit is contained in:
wonfen
2026-07-25 05:47:28 +08:00
committed by GitHub
parent 91d0643b5c
commit 7796259b03
47 changed files with 1644 additions and 192 deletions
+20
View File
@@ -0,0 +1,20 @@
interface MixedPortSources {
live?: number | null
runtime?: number | null
selected?: number | null
merge?: number | null
}
const isValidPort = (port: number | null | undefined): port is number =>
typeof port === 'number' &&
Number.isInteger(port) &&
port >= 1 &&
port <= 65535
export const resolveDisplayedMixedPort = ({
live,
runtime,
selected,
merge,
}: MixedPortSources): number =>
[live, runtime, selected, merge].find(isValidPort) ?? 7897