Module websocket

Module websocket 

Source
Expand description

NDN face over WebSocket (binary frames).

WebSocket provides its own message framing, so no TlvCodec is needed — each WebSocket binary message carries exactly one NDN packet (wrapped in NDNLPv2 LpPacket).

Supports both client-initiated (connect) and server-accepted (from_stream) connections. Compatible with NFD’s WebSocket face.

§TLS support (feature websocket-tls)

Enable the websocket-tls feature to unlock [TlsConfig] and [WebSocketFace::listen_tls]. Two modes are available:

  • [TlsConfig::SelfSigned] — an Ed25519 certificate is generated at runtime using rcgen; no external CA needed.
  • [TlsConfig::UserSupplied] — load a PEM certificate and private key from disk (e.g., Let’s Encrypt or your own CA).

Server-side TLS for ACME certificate distribution (SVS fleet cert sync) is targeted for v0.2.0.

Structs§

WebSocketFace
NDN face over WebSocket with binary message framing.