Skip to content

linux: fall back to a free proxy port when the configured one is taken - #236

Merged
misantronic merged 1 commit into
mainfrom
linux-port-fallback
Oct 12, 2026
Merged

misantronic merged 1 commit into
mainfrom
linux-port-fallback

Conversation

@misantronic

Copy link
Copy Markdown
Owner

On Linux handhelds a taken proxy port (8080 by default) made the start fail with "Port 8080 already in use - change proxy_port in config.json", which gave users no way to continue short of finding and editing the file.

  • When the configured port is busy and no healthy service is running, the start now takes the next free port (up to 50 above), saves it as proxy_port in config.json and logs a warning. If none is free, the old error is raised.
  • The menu starts the service before patching the emulator configs, so the patched host:port matches the port that was actually bound.
  • The old test for the error is replaced by tests for the fallback and for running out of ports.

Not covered: the DarkOS systemd path, which keeps its old behavior.

Tested

muOS device: stopped the service, held 8080 and 8081 with other listeners, then ran start-proxy. The log shows Port 8080 is in use, switched proxy_port to 8082, the proxy listened on 8082, and cheevos_custom_host was patched to 127.0.0.1:8082. The real install was restored afterwards.

@misantronic misantronic self-assigned this Oct 12, 2026
@misantronic misantronic added enhancement New feature or request Linux labels Oct 12, 2026
@misantronic

Copy link
Copy Markdown
Owner Author

@misantronic
misantronic merged commit 3958abc into main Oct 12, 2026
11 checks passed
@misantronic
misantronic deleted the linux-port-fallback branch October 12, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Linux

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant