mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-26 23:56:02 +08:00
2985ad2c14
When listen_port is 0 the OS assigns the port at bind time, so the configured value can no longer be trusted for building takeover URLs. - server: read listener.local_addr() after bind and propagate the actual port to the global proxy port, status, and ProxyServerInfo - services: start the proxy before takeover when port is 0 so live configs get the real port instead of :0, and persist the resolved port back to the DB for DB-only URL paths; stop the pre-started server on any takeover failure - claude_desktop: reject an unresolved :0 port instead of emitting a broken gateway URL - build_proxy_urls: prefer the running server's port and error out if the port is still 0 Add tests for takeover with an ephemeral port and the claude_desktop :0 rejection; switch existing codex takeover tests to an ephemeral port for isolation.