newWebSocket method

  1. @override
Future<WebSocket> newWebSocket(
  1. Uri uri, {
  2. Map<String, dynamic>? headers,
  3. Iterable<String>? protocols,
})
override

Construct a WebSocket instance that leverages SockJS for use in the browser.

Implementation

@override
Future<WebSocket> newWebSocket(Uri uri,
        {Map<String, dynamic>? headers, Iterable<String>? protocols}) =>
    SockJSWebSocket.connect(uri,
        debug: sockJSDebug,
        noCredentials: sockJSNoCredentials,
        protocolsWhitelist: sockJSProtocolsWhitelist,
        timeout: sockJSTimeout);