Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explanation about why package:web_socket exists #1207

Merged
merged 1 commit into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion pkgs/web_socket/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
[![pub package](https://img.shields.io/pub/v/web_socket.svg)](https://pub.dev/packages/web_socket)
[![package publisher](https://img.shields.io/pub/publisher/web_socket.svg)](https://pub.dev/packages/web_socket/publisher)

Any easy-to-use library for communicating with WebSockets that has multiple
Any easy-to-use library for communicating with
[WebSockets](https://en.wikipedia.org/wiki/WebSocket) that has multiple
implementations.

## Why another WebSocket package?

The goal of `package:web_socket` is to provide a simple, well-defined
[WebSockets](https://en.wikipedia.org/wiki/WebSocket) interface that has
consistent behavior across implementations.

[`package:web_socket_channel`](https://pub.dev/documentation/web_socket_channel/)
is currently the most popular WebSocket package. It has
two implementations, one based on `package:web` and the other based on
`dart:io` `WebSocket`. But those implementations do not have consistent
behavior.

[`WebSocket`](https://pub.dev/documentation/web_socket/latest/web_socket/WebSocket-class.html)
currently has three implementations (with more on the way) that
all pass the same set of
[conformance tests](https://github.com/dart-lang/http/tree/master/pkgs/web_socket_conformance_tests):

* [`BrowserWebSocket`](https://pub.dev/documentation/web_socket/latest/browser_web_socket/BrowserWebSocket-class.html)
* [`CupertinoWebSocket`](https://pub.dev/documentation/cupertino_http/latest/cupertino_http/CupertinoWebSocket-class.html)
* [`IOWebSocket`](https://pub.dev/documentation/web_socket/latest/io_web_socket/IOWebSocket-class.html)

## Using

```dart
Expand Down