Expand description
Loro WebSocket Server (simple skeleton)
Minimal async WebSocket server that accepts connections and echoes binary protocol frames back to clients. It also responds to text “ping” with text “pong” as described in protocol.md keepalive section.
This is intentionally simple and is meant as a starting point. Application
logic (authorization, room routing, broadcasting, etc.) should be layered
on top using the loro_protocol crate for message encoding/decoding.
Example (not run here because it binds a socket):
loro_websocket_server::serve("127.0.0.1:9000").await?;Re-exports§
pub use loro_protocol as protocol;
Structs§
- Load
DocArgs - Arguments provided to
on_load_document. - Loaded
Doc - Snapshot payload returned by
on_load_documentalongside optional metadata that will be passed through toon_save_document. - Save
DocArgs - Arguments provided to
on_save_document. - Server
Config
Functions§
- serve
- Start a simple broadcast server on the given socket address.
- serve_
incoming - Serve a pre-bound listener. Useful for tests to bind on port 0.
- serve_
incoming_ with_ config