sockjs_client_wrapper 1.0.1 copy "sockjs_client_wrapper: ^1.0.1" to clipboard
sockjs_client_wrapper: ^1.0.1 copied to clipboard

outdatedDart 1 only

A Dart wrapper for the `sockjs-client` JS library.

SockJS Client Wrapper #

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

Usage #

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

<!DOCTYPE html>
<html>
  <head> ... </head>
  <body>
    <!-- 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>
  </body>
</html>

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;
  client.send('Hello!');
  ...
}

Development #

To install dependencies:

$ npm install
$ pub get

To run the example:

$ node example/server.js
$ pub serve example

To run tests:

$ pub run ddev test
0
likes
0
pub points
70%
popularity

Publisher

verified publisherworkiva.com

A Dart wrapper for the `sockjs-client` JS library.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

js, logging, w_common

More

Packages that depend on sockjs_client_wrapper