WebSocketConnector typedef

WebSocketConnector = Future<WebSocketAdapter> Function(Uri uri, Iterable<String> protocols)

Creates and returns an open WebSocketAdapter.

Called by the client for every connection attempt. The returned adapter must already have completed its handshake (i.e. be ready to receive frames). The connector is permitted to throw — the client will treat throwing as a connection failure and apply its retry policy.

Implementation

typedef WebSocketConnector = Future<WebSocketAdapter> Function(
  Uri uri,
  Iterable<String> protocols,
);