ws 0.0.5-dev.placeholder copy "ws: ^0.0.5-dev.placeholder" to clipboard
ws: ^0.0.5-dev.placeholder copied to clipboard

WS: A compact, highly efficient WebSocket library. Easily establish, manage, and reconnect WebSocket connections in real-time apps.

example/ws_example.dart

// ignore_for_file: avoid_print

import 'dart:async';

import 'package:ws/ws.dart';

void main() {
  const url = 'wss://echo.plugfox.dev:443/connect';

  final client = WebSocketClient.connect(url)
    ..stream.listen((message) {
      print('< $message');
    })
    ..add('Hello, ').ignore()
    ..add('world!').ignore();

  Timer(const Duration(seconds: 5), client.close);
}
79
likes
0
pub points
86%
popularity

Publisher

verified publisherplugfox.dev

WS: A compact, highly efficient WebSocket library. Easily establish, manage, and reconnect WebSocket connections in real-time apps.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

meta

More

Packages that depend on ws