w_transport.browser library

Transport for the browser. Exposes a single configuration method that must be called before instantiating any of the transport classes.

import 'package:w_transport/browser.dart'
    show configureWTransportForBrowser;

void main() {
  configureWTransportForBrowser();
}

If you'd like WebSocket to fall back to XHR-streaming if native WebSockets are not available, w_transport can be configured to use a SockJS client.

import 'package:w_transport/browser.dart'
    show configureWTransportForBrowser;

void main() {
  configureWTransportForBrowser(
      useSockJS: true,
      sockJSProtocolsWhitelist: ['websocket', 'xhr-streaming']);
}

Classes

BrowserTransportPlatform
BrowserTransportPlatformWithSockJS

Constants

browserTransportPlatform → const BrowserTransportPlatform
browserTransportPlatformWithSockJS → const BrowserTransportPlatformWithSockJS

Functions

configureWTransportForBrowser({bool useSockJS: false, bool sockJSDebug: false, bool sockJSNoCredentials: false, List<String> sockJSProtocolsWhitelist}) → void
Configures w_transport for use in the browser via dart:html.