# sockjs_client_wrapper 1.0.4

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




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'sockjs_client_wrapper:1.0.4'
```
Published: 2018-07-02T20:04:58.645049Z
Expected archive SHA-256: 99a3959533c5215d12c467c5d78dda991776f9129cc5f8cb3b29bd93c0c455b5

Available in cache; verification: upstream_checksum
## Direct dependencies
- js: ^0.6.1
- w_common: ^1.9.0

## Package README (untrusted upstream documentation)
# SockJS Client Wrapper

A Dart wrapper around the [SockJS Client][sockjs-client]. Uses the
[`js` Dart package][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:

```html
<!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:

```dart
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:**
```bash
$ npm install
$ pub get
```

**To run the example:**
```bash
$ node example/server.js
```

```bash
$ pub serve example
```

**To run tests:**
```bash
$ pub run ddev test
```


[js-dart-package]: https://pub.dartlang.org/packages/js
[sockjs-client]: https://github.com/sockjs/sockjs-client

## Changelog
## 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.







 
