# sockjs_client_wrapper 1.0.2

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.2'
```
Published: 2018-02-02T20:08:32.895978Z
Expected archive SHA-256: 7c50fddedd592ead590f4a675c8527bcc55181fd3ca4de5639206d70676389ae

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







 
