connect static method

Future<SocketLink> connect(
  1. Uri endpoint, {
  2. Map<String, Object>? headers,
})

Connects to endpoint.

headers are sent with the upgrade request, for a server that authenticates there rather than in the query string.

Implementation

static Future<SocketLink> connect(
  Uri endpoint, {
  Map<String, Object>? headers,
}) async => WebSocketLink._(
  await WebSocket.connect(endpoint.toString(), headers: headers),
);