FLUTTER ECOSYSTEM

Workiva/sockjs_client_wrapper

SockJS クライアントの Dartラッパー。js Dartパッケージを使用して、JSライブラリと相互運用します。

sockjs_client_wrapper のプロジェクト画像
Stars
2
Forks
11
最終プッシュ(UTC)
2026/07/31
プロジェクト状態
公開中
Workiva GitHub avatar
GITHUB Organization

Workiva ↗

言語JavaScriptDartHTML

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 9 件

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

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

Install dependencies
$ npm install
$ dart pub get
Run the example
$ dart run dart_dev serve
Run tests
$ dart run dart_dev test