One session.
Calls both ways.

Pavia is a real-time RPC and messaging protocol between browsers or apps and servers. One persistent session carries typed calls in both directions, and the server can reach any session, user or group.

Read the docsRead the specification

Rust server · generated TypeScript client · Apache 2.0 or MIT

chat.rssketch
// One contract, both directions.
#[pavia::service]
trait Chat {
    async fn send(room: RoomId, text: String)
        -> Result<MsgId, ChatError>;
    fn history(room: RoomId) -> Stream<Message>;
}

// Server to client, same session.
#[pavia::client_service]
trait Ui {
    async fn confirm(prompt: String) -> bool;
}

let ok = ctx.session(id).ui().confirm("Leave room?").await?;

The code is illustrative.

CALLS

Four shapes, on one multiplexed session.

Every call has cancellation, deadlines, metadata and structured errors. Either side can be the caller.

  • Unary

    One request, one result. The everyday call.

  • Server stream

    One request, a stream of items back. Feeds, logs, progress.

  • Client stream

    Many items up, one result. Uploads, batched writes.

  • Bidirectional

    Both sides stream at once, with flow control on every binding.

How calls work

TRANSPORTS

WebTransport first. WebSocket everywhere else.

The client races both bindings and keeps the one that connects. Your code sees one logical protocol, and a session survives a dropped transport through resumption.

Browseror app
WebTransportHTTP/3, preferred
WebSocketfallback
Pavia serverRust · axum

BUILT IN

The parts you usually build yourself.

  • Targeting

    Call or notify one session, every session of a user, or a whole group.

  • Channels with history

    Durable history and gapless recovery after a reconnect.

  • Presence

    Know who is in a channel, with joins and leaves as events.

  • Datagrams

    Lossy, latest-value data such as cursors and telemetry.

  • Typed contracts

    A machine-readable manifest that client generators consume, with a compatibility checker.

  • Encode once, fan out

    Binary CBOR frames let routers read envelopes without decoding payloads.

SPEC FIRST

The spec is the reference implementation.

Behavior is written into the specification and its test vectors before it reaches code. A public conformance suite lets any implementation prove what it supports.

Read the specification

Conformance levels

  • Core
  • Streaming
  • Server calls
  • Auth lifecycle
  • Lanes
  • Datagrams
  • Resumption
  • Channels
  • History
  • Presence
BindingsWebSocket · WebTransport
Codecscbor · json

ROADMAP

Built in the open, one milestone at a time.

See the full roadmap
  1. M0 to M7

    The WebSocket binding, typed unary and streaming calls in both directions, the generated TypeScript client, targeting and the axum integration.

  2. Headline 0.x

    The WebTransport binding, transport racing with automatic fallback, datagrams and notification lanes.

  3. Feature complete

    Session resumption, the authentication lifecycle, channels with history, presence, the Rust client and TypeScript extras, and multi-node deployments.

  4. 1.0

    Production hardening, ergonomics, the specification frozen as 1.0 and the public conformance suite.

Follow Pavia as it grows.

Subscribe to the Pavia newsletter.

One email per milestone. Unsubscribe from any email.

Star wolfware-labs/pavia