Wiki source code of Yjs WebSocket Endpoint
Last modified by Eleni Cojocariu on 2025/08/05
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | == URL == | ||
2 | |||
3 | {{code language="javascript"}} | ||
4 | // Generic pattern | ||
5 | "ws://<host>/<webAppContextPath>/websocket/<wiki>/yjs" | ||
6 | |||
7 | // For a server running on localhost:8080 and subwiki dev, the url is: | ||
8 | "ws://localhost:8080/xwiki/websocket/dev/yjs" | ||
9 | {{/code}} | ||
10 | |||
11 | == Query Parameters == | ||
12 | |||
13 | A mandatory ##room## parameters must be provided when connecting to the WebSocket. ItsĀ value is a local document reference. | ||
14 | |||
15 | The edit right of the users are checked for the current user. The connection is closed if the check fails. | ||
16 | |||
17 | **Example**: | ||
18 | |||
19 | {{code language="javascript"}} | ||
20 | "ws://localhost:8080/xwiki/websocket/dev/yjs?room=Main.WebHome" | ||
21 | {{/code}} | ||
22 | |||
23 | == Know limitations == | ||
24 | |||
25 | The endpoint does not provide a mechanism to authenticate to the endpoint from another domain (see [[https://jira.xwiki.org/browse/XWIKI-23367]]). | ||
26 | Therefore, the endpoint is currently only usable when the client code is used in the same domain as the endpoint. |