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

Open Beginner friendly
#29,412 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
rust

Research direction

Start at the mobile relay page or the generated frontend code containing new WebSocket and search for the /client?room= connection. Reproduce with a copied /mobile?room=...&key=...&auto=1 URL and inspect the WebSocket request. Done means the request uses the URL's key value as the token rather than the room id.

Written by the indexing model from the issue text.

Description

app-server bug
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_
Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.