loro-websocket-server

Crates.ioloro-websocket-server
lib.rsloro-websocket-server
version0.1.0
created_at2025-11-30 15:27:15.689007+00
updated_at2025-11-30 15:27:15.689007+00
descriptionSimple async WebSocket server skeleton for the Loro protocol
homepage
repositoryhttps://github.com/loro-dev/protocol
max_upload_size
id1958368
size164,154
Zixuan Chen (zxch3n)

documentation

README

loro-websocket-server (Rust)

Minimal async WebSocket server for the Loro protocol. Broadcasts DocUpdates between clients and provides hooks for auth and persistence. It mirrors the TypeScript server in packages/loro-websocket.

Features

  • Supports %LOR, %EPH, %ELO (experimental/WIP) and related CRDT types with fragment reassembly (≤256 KiB per message).
  • Connection keepalive handling ("ping"/"pong" text frames).
  • Workspace isolation via URL path (/{workspace}) and optional handshake auth.
  • Load/save hooks with optional per-document metadata context to assist persistence.

%ELO is treated as an opaque encrypted payload on the server; the Rust client adaptor is snapshot-only today and considered WIP.

Quick start

Run the bundled SQLite-backed example:

cargo run -p loro-websocket-server --example simple-server -- --addr 127.0.0.1:9000 --db loro.db

Then connect clients to ws://127.0.0.1:9000/ws1.

Integrate your own storage by wiring ServerConfig.on_load_document and on_save_document.

Tests

cargo test -p loro-websocket-server
Commit count: 0

cargo fmt