Viewing version 1.0.5. Open the latest package page.

sockjs_client_wrapper

1.0.5

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

Download archive

Readme

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
Changelog

1.0.5

  • Dart 2 compatible.

1.0.4

  • Updated the SockJS library to v1.1.5 to pull in a fix for an issue where xhr_streaming loops infinitely after the connection closes.

1.0.3

  • Compatible with latest Dart 2.x dev channel and Dart Dev Compiler.

1.0.2

  • Logging was disabled as it was originally too verbose.

1.0.1

  • Add a version check to CI.

1.0.0

  • Initial release.

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'sockjs_client_wrapper:1.0.5'
pubspec.yaml
name: sockjs_client_wrapper
version: 1.0.5
description: A Dart wrapper for the `sockjs-client` JS library.
authors:
  - Workiva Client Platform Team <clientplatform@workiva.com>
  - Evan Weible <evan.weible@workiva.com>
homepage: https://github.com/Workiva/sockjs_client_wrapper

environment:
  sdk: '>=1.24.2 <3.0.0'

dependencies:
  js: ^0.6.1
  w_common: ^1.9.0
  
dev_dependencies:
  build_runner: ">=0.6.0 <1.0.0"
  build_test: ">=0.9.0 <1.0.0"
  build_web_compilers: ">=0.2.0 <1.0.0"
  coverage: '>=0.10.0 <0.13.0'
  dart_dev: ^1.9.5
  dart_style: ^1.0.8
  dependency_validator: ^1.2.1
  test: ^0.12.30

transformers:
- test/pub_serve:
    $include: test/**_test.dart

Version history

VersionPublishedArchiveSHA-256
0.0.0Cached · Upstream SHA-256 matchedDownloadc70e75a9…986629
1.0.1Cached · Upstream SHA-256 matchedDownload95466024…032d5a
1.0.2Cached · Upstream SHA-256 matchedDownload7c50fdde…6389ae
1.0.3Cached · Upstream SHA-256 matchedDownload152626c7…92031f
1.0.4Cached · Upstream SHA-256 matchedDownload99a39595…c455b5
1.0.5Cached · Upstream SHA-256 matchedDownloadcff60f08…13a614
1.0.7Cached · Upstream SHA-256 matchedDownload5e93cdb8…64e507
1.0.8Cached · Upstream SHA-256 matchedDownload9363bb25…a5ec95
1.0.9Cached · Upstream SHA-256 matchedDownload0e106bb5…39c176
1.0.10Cached · Upstream SHA-256 matchedDownload684d9825…638b86
1.0.11Cached · Upstream SHA-256 matchedDownload513cb297…e286d9
1.0.14Cached · Upstream SHA-256 matchedDownload164d523b…3968ec
1.1.0Cached · Upstream SHA-256 matchedDownload6649993f…0b7d53
1.1.1Cached · Upstream SHA-256 matchedDownloadb6c02919…3589eb
1.1.2Cached · Upstream SHA-256 matchedDownload47dc3039…289233
1.1.3Cached · Upstream SHA-256 matchedDownload4972f92e…dc667c
1.1.4Cached · Upstream SHA-256 matchedDownload67c6ac08…fca1ab
1.1.5Cached · Upstream SHA-256 matchedDownload59e284fb…9aa032
1.1.8Cached · Upstream SHA-256 matchedDownload5cbcb0bd…94b5e0
1.1.12Cached · Upstream SHA-256 matchedDownloade6e57e39…f6a543
1.2.0Cached · Upstream SHA-256 matchedDownloadc304e85f…917054
1.3.0Cached · Upstream SHA-256 matchedDownloadb050d453…492937
1.4.0Cached · Upstream SHA-256 matchedDownload179c6d20…620e36
1.4.1Cached · Upstream SHA-256 matchedDownloada55be049…e94089
1.5.0Cached · Upstream SHA-256 matchedDownload2202c5cf…5dd6c0

Dependencies

js "^0.6.1"

w_common "^1.9.0"