web_socket_channel_connect
Table of Contents
Introduction
A small wrapper for the web_socket_channel package that throws a synchronous error if the connection fails.
This addresses the following open issues on the web_socket_channel package:
- https://github.com/dart-lang/web_socket_channel/issues/226
- https://github.com/dart-lang/web_socket_channel/issues/220
- https://github.com/dart-lang/web_socket_channel/issues/214
- https://github.com/dart-lang/web_socket_channel/issues/209
Usage
import 'package:web_socket_channel_connect/web_socket_channel_connect.dart';
Future<void> main() async {
final channel = connectWebSocket(Uri.parse('ws:localhost:5333'));
channel.stream.listen((message) {});
}