From c7d66e20a8f14d9fdf8e84c03e50dcd44893bd2f Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:28:58 +0900 Subject: [PATCH] docs(selkies): Give the protocol page the WebSocket path and the token's other forms The pages document the session token in the fragment and /api/tokens since the 2.1.0 sync, but the protocol page still connected to the v1 images' websocket location, and left out a fragment token after a role or display keyword and the Selkies-Authorization header, which carries the master token for a caller behind a Basic login. --- docs/selkies/developer-guide/protocol.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/selkies/developer-guide/protocol.md b/docs/selkies/developer-guide/protocol.md index e2c58df63..8a4c56519 100644 --- a/docs/selkies/developer-guide/protocol.md +++ b/docs/selkies/developer-guide/protocol.md @@ -4,10 +4,10 @@ The wire protocol between the Selkies server and the web client, for anyone impl ## Connection and roles -The client connects to `wss://host/websocket`. Role assignment happens one of two ways: +The client connects to `wss://host/api/websockets`. Role assignment happens one of two ways: - **Fragment mode** (default): the URL fragment the page was opened with decides the role, `#shared` (view only), `#player2` through `#player4` (gamepad slot only), `#display2-right` and friends (second monitor surface). No fragment means a controller: the first page owns the display's size, and later pages on the plain address join beside it with full control. -- **Token mode** (when the server was started with `SELKIES_MASTER_TOKEN`): the page is opened with `#token=` in the fragment, where no request line or proxy log sees it, or `?token=` in the query, and the client offers the token to the WebSocket as the `selkies.token.` subprotocol or as `?token=`. Tokens and their roles are registered by the orchestrator via `POST /api/tokens` on the normal port with the master token as a bearer credential, or read from `SELKIES_TOKENS_FILE`. Close codes: `4000` server shutting down, `4001` invalid token, `4002` revoked, `4029` reconnecting too fast. +- **Token mode** (when the server was started with `SELKIES_MASTER_TOKEN`): the page is opened with `#token=` in the fragment (after a role or display fragment: `#display2-right&token=`), where no request line or proxy log sees it, or `?token=` in the query, and the client offers the token to the WebSocket as the `selkies.token.` subprotocol or as `?token=`. Tokens and their roles are registered by the orchestrator via `POST /api/tokens` on the normal port with the master token as a bearer credential (`Authorization`, or `Selkies-Authorization` beside a Basic login), or read from `SELKIES_TOKENS_FILE`. Close codes: `4000` server shutting down, `4001` invalid token, `4002` revoked, `4029` reconnecting too fast. On success the server sends `MODE websockets`, an auth confirmation with the assigned role, and a `server_settings` JSON message containing every tunable setting with its value, allowed range or enum, and locked flag, this single message is what renders the sidebar UI, which is why locking a setting server side removes the control everywhere.