WebSocketConnector typedef
WebSocketConnector =
Future<WebSocket> Function(Uri uri, {Map<String, String> ? headers, Iterable<String> ? protocols})
Factory function to create a WebSocket connection. Allows consumers to provide custom WebSocket implementations (e.g., CupertinoWebSocket, OkHttpWebSocket).
The headers parameter contains extra headers from OptionBuilder.setExtraHeaders.
You may use this parameter to add authentication or custom headers.
Implementation
typedef WebSocketConnector = Future<ws.WebSocket> Function(
Uri uri, {
Iterable<String>? protocols,
Map<String, String>? headers,
});