websocket library
Coordination over a WebSocket relay hub.
Web-safe: uses package:web_socket_channel, which is one API over
dart:io sockets on the VM and the browser's WebSocket on the web.
A node connects to a hub — see package:peer_coordinator/hub.dart, or run
dart run peer_coordinator:hub — which relays frames between peers. The
hub is role-blind: election, membership and stream lifecycle all stay
client-side, exactly as they are over LSL.
Classes
- HubCloseCode
- WebSocket close codes the hub uses to say why it hung up.
- HubCredentials
- The shared secret for one hub session.
- WebSocketTransport
- Coordination over a WebSocket relay hub.
- WebSocketTransportConfig
- Configuration for the WebSocket transport.
- WsConnection
- The single WebSocket a node holds to the hub.
- WsCoordinationStream
- Coordination stream over a hub. Reliable, ordered, JSON.
- WsDataStream
- Data stream over a hub.
- WsDiscovery
- IDiscovery backed by the hub's peer registry.
- WsFrame
- A control frame.
- WsInbound
- A relayed message addressed to one of this node's endpoints.
- WsLimits
- What a hub will accept before it stops being polite.
- WsNetworkStreamFactory
- Builds WebSocket streams for a session.
- WsPeerHandle
- A peer the hub told us about.
- WsSampleFrame
- Binary framing for data-stream samples.
- WsSignal
- A signalling payload from one peer to another, forwarded by the hub.
Enums
- WsControl
- Control-frame types.
Mixins
-
WsStreamMixin<
T extends NetworkStreamConfig, M extends IMessage< IMessageType> > - Shared behaviour for WebSocket-backed streams.
Constants
- wsProtocolVersion → const int
- Wire protocol version. Bumped on any incompatible framing change.
Exceptions / Errors
- HubConnectionException
- Thrown when the hub refuses or ends a connection.
- WsFrameTooLargeException
- Thrown when a frame this node is about to send exceeds WsLimits.maxFrameBytes.