Viewing version 1.4.0. Open the latest package page.
sockjs_client_wrapper
1.4.0A Dart wrapper for the `sockjs-client` JS library.
Readme
SockJS Client Wrapper
A Dart wrapper around the SockJS Client. Uses the js Dart package to interop with the JS lib. The JS lib is vendored at lib/sockjs.js. The vendored lib is of sockjs-client v1.6.1 with one modification: the client does not make a /info request when establishing the connection.
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
Install dependencies
$ npm install
$ dart pub get
Run the example
$ dart run dart_dev serve
Run tests
$ dart run dart_dev test
Changelog
1.3.0
- Add
debugUrlfield toSockJSOpenEvent, which will be set to the full SockJS URL connected to by the underlying transport when using the unminifiedsockjs.jsasset.
1.2.0
- Migrate to null safety. SDK constraint raised to 2.12
1.1.12
- Update SockJS library to 1.6.1.
1.1.9
- CI tweaks.
1.1.8
- Dependency upgrades.
- Simplify Github CI workflow.
- Formatting and analysis lints.
1.1.6
- Replace deprecated
pubcommands
1.1.4 - 1.1.5
- Dependency upgrades.
1.1.0
- Update SockJS library to 1.5.0 and add sourcemaps.
1.0.14
- Raise Dart SDK minimum to 2.4.0
1.06 - 1.0.13
- Internal changes and CI updates.
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.4.0'pubspec.yaml
name: sockjs_client_wrapper
version: 1.4.0
description: A Dart wrapper for the `sockjs-client` JS library.
homepage: https://github.com/Workiva/sockjs_client_wrapper
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies:
js: ^0.6.1
w_common: '>=2.0.0 <4.0.0'
dev_dependencies:
build_runner: ^2.1.2
build_test: ^2.1.3
build_web_compilers: '>=3.0.0 <5.0.0'
dart_dev: '>=3.6.5 <5.0.0'
dependency_validator: ^3.2.0
test: ^1.15.7
workiva_analysis_options: ^1.3.0
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.0.0 | Cached · Upstream SHA-256 matched | Download | c70e75a9…986629 |
| 1.0.1 | Cached · Upstream SHA-256 matched | Download | 95466024…032d5a |
| 1.0.2 | Cached · Upstream SHA-256 matched | Download | 7c50fdde…6389ae |
| 1.0.3 | Cached · Upstream SHA-256 matched | Download | 152626c7…92031f |
| 1.0.4 | Cached · Upstream SHA-256 matched | Download | 99a39595…c455b5 |
| 1.0.5 | Cached · Upstream SHA-256 matched | Download | cff60f08…13a614 |
| 1.0.7 | Cached · Upstream SHA-256 matched | Download | 5e93cdb8…64e507 |
| 1.0.8 | Cached · Upstream SHA-256 matched | Download | 9363bb25…a5ec95 |
| 1.0.9 | Cached · Upstream SHA-256 matched | Download | 0e106bb5…39c176 |
| 1.0.10 | Cached · Upstream SHA-256 matched | Download | 684d9825…638b86 |
| 1.0.11 | Cached · Upstream SHA-256 matched | Download | 513cb297…e286d9 |
| 1.0.14 | Cached · Upstream SHA-256 matched | Download | 164d523b…3968ec |
| 1.1.0 | Cached · Upstream SHA-256 matched | Download | 6649993f…0b7d53 |
| 1.1.1 | Cached · Upstream SHA-256 matched | Download | b6c02919…3589eb |
| 1.1.2 | Cached · Upstream SHA-256 matched | Download | 47dc3039…289233 |
| 1.1.3 | Cached · Upstream SHA-256 matched | Download | 4972f92e…dc667c |
| 1.1.4 | Cached · Upstream SHA-256 matched | Download | 67c6ac08…fca1ab |
| 1.1.5 | Cached · Upstream SHA-256 matched | Download | 59e284fb…9aa032 |
| 1.1.8 | Cached · Upstream SHA-256 matched | Download | 5cbcb0bd…94b5e0 |
| 1.1.12 | Cached · Upstream SHA-256 matched | Download | e6e57e39…f6a543 |
| 1.2.0 | Cached · Upstream SHA-256 matched | Download | c304e85f…917054 |
| 1.3.0 | Cached · Upstream SHA-256 matched | Download | b050d453…492937 |
| 1.4.0 | Cached · Upstream SHA-256 matched | Download | 179c6d20…620e36 |
| 1.4.1 | Cached · Upstream SHA-256 matched | Download | a55be049…e94089 |
| 1.5.0 | Cached · Upstream SHA-256 matched | Download | 2202c5cf…5dd6c0 |
Dependencies
js "^0.6.1"
w_common "\u003e=2.0.0 \u003c4.0.0"