connect static method
Create a new WebSocket connection. The given uri must use the scheme
ws or wss.
Specify the subprotocols the client is willing to speak via protocols.
Additional headers to be used in setting up the connection can be
specified in headers. This only applies to server-side usage. See
dart:io's WebSocket for more information.
Implementation
static Future<WebSocket> connect(Uri uri,
{Map<String, dynamic>? headers, Iterable<String>? protocols}) =>
MockWebSocketInternal.handleWebSocketConnection(uri,
headers: headers, protocols: protocols);