Mobile relay page uses room id as WebSocket token instead of key

Open 💬 0 comments Opened Jun 22, 2026 by Naflajty

What issue are you seeing?

The Codex++ mobile relay page ignores the key query parameter when opening the WebSocket client connection.

The copied mobile URL contains separate room and key values:

/mobile?room=<room-id>&key=<long-key>&auto=1

### What steps can reproduce the bug?

The Codex++ mobile relay page ignores the `key` query parameter when opening the WebSocket client connection.

The copied mobile URL contains separate `room` and `key` values:

```text
/mobile?room=<room-id>&key=<long-key>&auto=1
However, the generated frontend code opens the WebSocket like this:
socket = new WebSocket(`${scheme}://${location.host}/client?room=${room}&token=${room}`);
This means the client connects with token equal to the room id instead of using the key value from the mobile URL.
Observed behavior:
The WebSocket handshake succeeds with 101 Switching Protocols.
The mobile page then shows app-server connection timeout.
In DevTools Network, the WebSocket request is:
/client?room=<room-id>&token=<same-room-id>
Expected behavior:
The mobile page should use the key query parameter as the WebSocket token, for example:
const token = encodeURIComponent($("key").value.trim());
socket = new WebSocket(`${scheme}://${location.host}/client?room=${room}&token=${token}`);
If the relay expects the parameter name key, then it should use:
socket = new WebSocket(`${scheme}://${location.host}/client?room=${room}&key=${token}`);

### What is the expected behavior?

```markdown
1. Open Codex++ management console.
2. Go to Mobile Control.
3. Select the public relay server.
4. Click "Start and copy mobile link".
5. Open the copied `/mobile?room=...&key=...&auto=1` URL in Microsoft Edge on Android.
6. Open DevTools / remote debugging and inspect the Network tab.
7. Check the WebSocket request to `/client`.

The page opens:

```text
/mobile?room=<room-id>&key=<long-key>&auto=1
But the WebSocket request becomes:
/client?room=<room-id>&token=<room-id>
The key value is not used.

Environment:

```markdown
- Codex++ mobile control relay
- Public relay server: `154.201.90.76:57323`
- Browser: Microsoft Edge on Android
- Device: OnePlus 13
- Result confirmed via browser DevTools Network panel

### Additional information

_No response_

View original on GitHub ↗