connect static method

Future<WebSocket> connect(
  1. Uri url, {
  2. Iterable<String>? protocols,
})

Create a new WebSocket connection.

The URL supplied in url must use the scheme ws or wss.

If provided, the protocols argument indicates that subprotocols that the peer is able to select. See RFC-6455 1.9.

Implementation

static Future<WebSocket> connect(Uri url, {Iterable<String>? protocols}) =>
    connector.connect(url, protocols: protocols);