Repository navigation
feat: web page port in Network, the next free one when taken; camex 4.1.2 (2.25.0) - #285
Conversation
….1.2 (2.25.0) The debug page listens on the port set in Network -> Web page port (default 8085, as before). When it is taken, for example by another of our apps on the device, the server takes the next free one (up to nine on), logs which and why, and /stats.json, the debug text and the dialog show the real port. The camex tunnel is told the port the page really got: a start waits until the page has tried its port (no restart right after the app's start), and a running tunnel restarts when the port changes (Network, or taken later). camex 4.1.2 (OpenIPC/camex#187): from the tunnel the library lets in only the app's own web port held by the app itself; the server shows an error rather than another app's page. tests/e2e.sh: the port taken by adbd (adb reverse tcp:8085): the page is on 8086 through the tunnel, 8085 through the tunnel is refused; the camera check waits for the reader, which takes longer with the round trip. Closes #284
PR Summary by QodoMake the debug page port configurable with safe tunnel fallback
AI Description
Merge Risk
|
Code Review by Qodo
1. Network can turn back on after being disabled
|
|
Qodo review on d4e4dda — all five are real; fixed in the next PR (the brass PR for #286, which rewrites the same code), not here, so this green head merges:
|
Closes #284.
Decided for all our Android apps (2026-11-18): the web page is on 8085 by default, the port is settable, and when it is taken the app takes the next free one and shows the real address. One app with a page and a camex tunnel runs on a device at a time; this keeps two from clashing when they do.
WebPort): 1024 to 65535, empty = 8085; checked on Save.DebugServer: binds the set port or the next free one of ten (8085 … 8094), logs which and why;port()is the real one; a port change in Network rebinds at once./stats.jsonaddresses, the debug text and the dialog show the real port.web_portis the port the page really got. A start waits until the page has tried its port (so a taken 8085 does not mean a tunnel restart right after the app starts — such a restart in one process is what Android 5 handles worst); a running tunnel restarts when the port changes later.bundles/camex→53c3dd8(4.1.2, Android library: the tunnel reaches other apps' servers (another app's page under this client's name) camex#187): from the tunnel the library lets in only the app's own web port, held by the app itself; anything else is refused, so the server shows an error rather than another app's page (seen on a TECNO KM4 with MicroSNANDer on 8085).docs/debug.md,docs/security.md,docs/testing.md.tests/e2e.sh: adbd holds 8085 (adb reverse tcp:8085), Decoder restarts: the page is on 8086 through the tunnel (401 / 200 with the password,addressessay:8086), 8085 through the tunnel is refused. The camera check now also waits for the reader (with the 60 ms round trip the RTSP setup can end a few seconds after the session is created on Android 5).Tests (local, Docker):
testDebugUnitTest lintDebug assembleDebugincompot/android:2026.10: pass (newWebPortTest; lint 13 warnings, as before).TRANSPORT=TCP tests/e2e.sh 21three times: 18 passed each;TRANSPORT=TCP tests/e2e.sh 34: 18 passed;tests/e2e.sh 34(UDP): 17 passed. Before the start was made to wait, API 21 failed the taken-port check in 2 of 4 runs.