Expand description
Yjs Sync Protocol Implementation
This module implements the y-websocket sync protocol for compatibility with Hocuspocus/y-websocket clients. The protocol flow is:
- Client connects and sends SyncStep1(client_state_vector)
- Server responds with SyncStep2(server_diff) + SyncStep1(server_state_vector)
- Client sends SyncStep2(client_diff)
- Ongoing: Both sides exchange Update messages
Note: Awareness protocol (for cursors/presence) is handled by forwarding messages between clients without server-side state.
Structs§
- DocHandler
- A handler for a single Yjs document/room Manages the document state, persistence, and broadcasting
Constants§
- MSG_
AUTH - MSG_
AWARENESS - MSG_
QUERY_ AWARENESS - MSG_
SYNC - Message types for y-websocket protocol The first byte of each message indicates its type