Crate loro_websocket_server

Crate loro_websocket_server 

Source
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§

LoadDocArgs
Arguments provided to on_load_document.
LoadedDoc
Snapshot payload returned by on_load_document alongside optional metadata that will be passed through to on_save_document.
SaveDocArgs
Arguments provided to on_save_document.
ServerConfig

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