SockJS Client Wrapper

A Dart wrapper around the SockJS Client. Uses the js Dart package to interop with the JS lib.


Include the SockJS library in your app's index.html prior to the main Dart/JS script:

<!DOCTYPE html>
  <head> ... </head>
    <!-- For local dev/debugging, use the unminified version: -->
    <script src="/packages/sockjs_client_wrapper/sockjs.js"></script>

    <!-- In production, use the minified version:  -->
    <script src="/packages/sockjs_client_wrapper/sockjs_prod.js"></script>

Import package:sockjs_client_wrapper/sockjs_client_wrapper.dart and create a SockJSClient instance that will connect to a SockJS server:

import 'package:sockjs_client_wrapper/sockjs_client_wrapper.dart';

Future<Null> main() async {
  final client = new SockJSClient(Uri.parse('ws://localhost:9000/echo'));
  await client.onOpen.first;


Install dependencies

$ npm install
$ dart pub get

Run the example

$ dart run dart_dev serve

Run tests

$ dart run dart_dev test