ws library

Classes

Hooks
Spry websocket hooks.
Message
WebSocket message,
Peer
Websocket peer.

Extension Types

ReadyState
WebSocket's ready state.

Extensions

RoutesWS on Routes
The ws extension.

Functions

defineHooks({required FutureOr<void> message(Peer peer, Message message), FutureOr<void> open(Peer peer)?, FutureOr<void> close(Peer peer, [int? code, String? reason])?, FutureOr<void> error(Peer peer, Object? error)?, FutureOr<Headers?> upgrade(Event event)?}) Hooks
Define a Hooks.
onUpgrade(Event event, UpgradeHandle handle) → void
WebSocket on upgrade hook, Handler calls upgrade to run.
upgrade(Event event, Hooks hooks) Future<bool>
Upgrade request event to websocket.

Typedefs

UpgradeHandle = FutureOr<bool> Function(Hooks)
Websocket Upgrade handle.