Skip to content

Commit

Permalink
Add explanation about why package:web_socket exists (#1207)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianquinlan authored May 23, 2024
1 parent 7df2ac8 commit 1a1b939
Showing 1 changed file with 23 additions and 1 deletion.
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

0 comments on commit 1a1b939

Please sign in to comment.