v1.5.0
sockjs_client_wrapper
`sockjs-client` JS 라이브러리용 Dart 래퍼입니다.
0좋아요 2.4만30일 다운로드120Pub 점수
Web
SockJS 클라이언트를 둘러싼 Dart 래퍼입니다. JS 라이브러리와 상호 운용하기 위해 js Dart 패키지를 사용합니다.
^0.6.1>=2.0.0 <5.0.0^2.1.2^2.1.3>=3.0.0 <5.0.0>=3.6.5 <5.0.0^3.2.0^1.15.7^1.3.0아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A Dart wrapper around the SockJS Client. Uses the
js Dart package to interop with the JS lib.
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!');
...
}
$ npm install
$ dart pub get
$ dart run dart_dev serve
$ dart run dart_dev test