hub_core library

The hub's logic, without a server: for hosting a room from a browser.

Web-safe, unlike package:peer_coordinator/hub.dart. Hand HubCore a HubLink per peer — a WebRTC data channel, or HubLink.pair for the hosting page's own node — and point each peer's WebSocketTransportConfig at its end of the link with connector. The security model is the same as the server hub's: everyone holding the secret is in one trust domain.

Classes

HubCloseCode
WebSocket close codes the hub uses to say why it hung up.
HubCore
A role-blind relay.
HubCredentials
The shared secret for one hub session.
A message-oriented, ordered, reliable link carrying text and binary frames.
A HubLink over a package:web_socket_channel socket.
WsLimits
What a hub will accept before it stops being polite.

Enums

HubSessionStatus
Whether a hub is currently admitting peers.

Typedefs

HubConnector = Future<HubLink> Function()
Opens a link to a hub. Used in place of dialling hubUri when given.