-
Notifications
You must be signed in to change notification settings - Fork 383
Merge package:web_socket_channel
#1420
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
Merged
Merged
Changes from all commits
Commits
Show all changes
153 commits
Select commit
Hold shift + click to select a range
03d6e8a
Initial template.
nex3 033f017
Copy the web socket stuff from http_parser.
nex3 8ab3304
Add an IO implementation of WebSocketChannel.
nex3 c1aa7fd
Get rid of WebSocketChannel.pingInterval.
nex3 c053965
Add an HTML implementation of WebSocketChannel.
nex3 23cf181
Add a top-level status library.
nex3 ff67146
Update the SDK constraint.
nex3 e8bb6fb
Add support for crypto 1.0.0..
nex3 8c22a3e
Use BASE64 from package:convert.
nex3 f8324fa
Bring in the latest version of the SDK's WebSocket impl.
nex3 d4a3f9f
WebSocket.close doesn't like passing null arguments
Fox32 e0eaef1
Add a comment explaining the new conditional.
nex3 a5c982f
Update the pubspec and add a CHANGELOG entry.
nex3 5136a8c
Merge branch 'Fox32.master'
nex3 29657f9
Fix all strong-mode errors and warnings.
nex3 66fc478
Support crypto 2.0.0.
nex3 ae277bc
Use hybrid tests to test the dart:html impl. (dart-lang/web_socket_ch…
nex3 5d64ac0
add library names; increase the sdk constraint
devoncarew 6988e80
Merge pull request dart-lang/web_socket_channel#7 from devoncarew/sdk…
devoncarew fc0431d
enable travis
kevmoo 39923b9
dartfmt
kevmoo 06f4dba
Fix analysis warnings
kevmoo 40542b0
cleanup gitignore
kevmoo 5f53af5
Lint cleanup: initialize to null, return values on setter, comment sy…
kevmoo 724299c
Remove -dev.infinity in SDK upper constraint
kevmoo 8ba2889
Declare support for async 2.0.0 (dart-lang/web_socket_channel#9)
nex3 6ad1e81
Updates for Dart 2.0 corelib changes (wave 2.2)
leafpetersen 8ec1cc3
Bring in code from the latest SDK (dart-lang/web_socket_channel#12)
nex3 20c810c
Stop testing on Dartium
nex3 08d2994
Stop testing on stable
nex3 9cee0f7
Merge pull request dart-lang/web_socket_channel#13 from dart-lang/fix…
nex3 2ea1544
Merge remote-tracking branch 'origin/corelib_2_2_1_branch'
nex3 e61598e
Fix wrong listener in README.md (dart-lang/web_socket_channel#18)
loint 4987c7b
Remove usage of deprecated constants. (dart-lang/web_socket_channel#20)
lrhn 568fe8a
dartfmt code and use latest pkg:test API
kevmoo b4b06e4
chore: set max SDK version to <3.0.0 (dart-lang/web_socket_channel#27)
chalin 8fd103c
Fix sample code in README (dart-lang/web_socket_channel#30)
DanTup 39992df
improve pub score (dart-lang/web_socket_channel#33)
felangel 910570c
enable and fix a number of lints
kevmoo 2401f0a
Fix doc links in readme
kevmoo 3f643c3
Update README.md (dart-lang/web_socket_channel#29)
analogic 6111df8
Update .gitignore to new `dart_tool` pub cache (dart-lang/web_socket_…
bcko 81441b7
repo cleanup
kevmoo 7cf41e9
Prepare for 1.0.10 (dart-lang/web_socket_channel#47)
kevmoo 5406b14
Link and description fixes
kevmoo 07a0aa6
Allow stream_channel version 2.x (dart-lang/web_socket_channel#48)
natebosch 2904d39
Declare a return value of `Uint8List` in `BytesBuilder` methods (dart…
tvolkert 7f2a337
Update to handle Socket implements Stream<Uint8List> (dart-lang/web_s…
tvolkert 99d66e6
Fix pedantic dependency, update links in readme
kevmoo 68b946c
Forward protocols parameter to WebSocket (dart-lang/web_socket_channe…
chungheepark 836ed41
Use `drain` to reach end of stream in tests (dart-lang/web_socket_cha…
natebosch 98e9f48
Add `WebSocketChannel.connect` factory constructor.
jacob314 38d3159
Require Uri.
jacob314 6a6630a
Merge pull request dart-lang/web_socket_channel#83 from dart-lang/con…
jacob314 d328a28
Fix newly enforce package:pedantic lints (dart-lang/web_socket_channe…
natebosch 1755c74
Add Travis badge to readme
kevmoo 13ebb73
Ignore unused fields in private class – copied from SDK
kevmoo cc18c87
Add optional protocols argument to WebSocketChannel.connect (dart-lan…
ganigeorgiev f2e5ba7
Add changelog for dart-lang/web_socket_channel#97 (dart-lang/web_sock…
natebosch 7d6d810
Remove author from the pubspec
kevmoo 61d32b0
Clean up some style (dart-lang/web_socket_channel#120)
natebosch 97ab45e
use chrome to test on Travis (dart-lang/web_socket_channel#121)
kevmoo 613c651
Add a language version tag in spawnHybridUri (dart-lang/web_socket_ch…
natebosch 4d5a78b
Use SDK version of BytesBuilder (dart-lang/web_socket_channel#130)
natebosch 3f369c3
Delete .test_config
kevmoo 8f90f95
Merge pull request dart-lang/web_socket_channel#133 from dart-lang/ke…
jakemac53 7da76eb
Fix usage of deprecated list ctor (dart-lang/web_socket_channel#140)
natebosch cb5b3a1
Allow the null safe package:crypto (dart-lang/web_socket_channel#139)
natebosch 9363836
Migrate to GitHub Actions (dart-lang/web_socket_channel#146)
athomas b3c6429
Enable and fix a number of lints, disallow implicit casts (dart-lang/…
kevmoo dafff91
Use new setup actions (dart-lang/web_socket_channel#153)
kevmoo d1d3229
null safety (dart-lang/web_socket_channel#154)
kevmoo 624e2f2
prepare stable, null-safe v2 (dart-lang/web_socket_channel#155)
kevmoo e230f43
Latest setup, test on oldest supported SDK (dart-lang/web_socket_chan…
kevmoo 6290154
Update LICENSE
franklinyow b8febe8
Merge pull request dart-lang/web_socket_channel#163 from dart-lang/fr…
franklinyow d60d2a3
Add IOWebSocketChannel.innerWebSocket
natebosch 12ae6a9
Remove extra ` character (dart-lang/web_socket_channel#173)
natebosch b033615
Prepare to publish (dart-lang/web_socket_channel#174)
natebosch 6cd8bb2
Tweak import recommendation phrasing (dart-lang/web_socket_channel#180)
micimize 7081702
Fix IOWebSocketChannel import in readme (dart-lang/web_socket_channel…
LeonardoRosaa 93e6300
Add HtmlWebSocketChannel.innerWebSocket (dart-lang/web_socket_channel…
chirag729 56f212b
Use platform agnostic example in README.md (dart-lang/web_socket_chan…
masus04 6d0f91c
Remove language version from spawnHybrid code (dart-lang/web_socket_c…
a-siva c55aa62
blast_repo fixes (dart-lang/web_socket_channel#235)
kevmoo ec54227
Add WebSocketChannel.`ready` field and IOWebSocketChannel factory `co…
iota9star 8ebdb50
Bump actions/checkout from 3.1.0 to 3.2.0 (dart-lang/web_socket_chann…
dependabot[bot] 025fc79
Update analysis_options.yaml (dart-lang/web_socket_channel#247)
srawlins a4f3888
Fix CI link in readme (dart-lang/web_socket_channel#248)
kevmoo 3b2384a
Bump actions/checkout from 3.2.0 to 3.3.0 (dart-lang/web_socket_chann…
dependabot[bot] d279a9a
Bump dart-lang/setup-dart from 1.3 to 1.4 (dart-lang/web_socket_chann…
dependabot[bot] 9347256
Bump actions/checkout from 3.3.0 to 3.5.0 (dart-lang/web_socket_chann…
dependabot[bot] db81509
Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (dart-lang/web_socket_c…
dependabot[bot] e0d4c64
Fix deprecated_new_in_comment_reference (dart-lang/web_socket_channel…
natebosch b9a7acb
Allow passing through custom http client in IO socket connect (dart-l…
Rexios80 7cc41ca
Bump actions/checkout from 3.5.0 to 3.5.2 (dart-lang/web_socket_chann…
dependabot[bot] 2f87d84
blast_repo fixes (dart-lang/web_socket_channel#269)
devoncarew 788480b
Make it more clear how `WebSocketChannel.ready` should be used. (dart…
brianquinlan a02b8cb
Add a note explaining why the onerror doesn't generate a more detaile…
brianquinlan d0f5c4b
Bump actions/checkout from 3.5.2 to 3.5.3 (dart-lang/web_socket_chann…
dependabot[bot] d8b8d86
Correction in Code Snippet (dart-lang/web_socket_channel#275)
jithuraj 0a5cbc4
Bump actions/checkout from 3.5.3 to 3.6.0 (dart-lang/web_socket_chann…
dependabot[bot] 577f267
Bump actions/checkout from 3.6.0 to 4.1.0 (dart-lang/web_socket_chann…
dependabot[bot] 7746475
Bump dart-lang/setup-dart from 1.5.0 to 1.5.1 (dart-lang/web_socket_c…
dependabot[bot] e9365c2
Mention `ready` in the docs for `connect` (dart-lang/web_socket_chann…
natebosch 2adef16
Bump actions/checkout from 4.1.0 to 4.1.1 (dart-lang/web_socket_chann…
dependabot[bot] 198936e
Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (dart-lang/web_socket_c…
dependabot[bot] dd5adfd
Migrate to latest lints, bump min SDK to Dart 3.2 (dart-lang/web_sock…
kevmoo 481ea06
migrate to pkg web (dart-lang/web_socket_channel#294)
kevmoo 0e0de69
Small tweak (dart-lang/web_socket_channel#295)
kevmoo 325d9bc
Drop some use of ! (dart-lang/web_socket_channel#296)
natebosch df37a53
Remove removed lints (dart-lang/web_socket_channel#299)
osa1 16acf73
Fix JS value to Dart conversion when receiving from a web socket (dar…
osa1 63d83c9
blast_repo fixes (dart-lang/web_socket_channel#302)
kevmoo 098a0f1
Rename helper extensions to not collide with pkg:web unreleased (dart…
kevmoo b412bd7
CI: test dev SDK with dart2wasm (dart-lang/web_socket_channel#304)
kevmoo beca829
Prepare release v2.4.1 (dart-lang/web_socket_channel#301)
kevmoo 9f7bc35
Bump actions/stale from 8.0.0 to 9.0.0 (dart-lang/web_socket_channel#…
dependabot[bot] 03aff6b
Allow pkg:web v0.3.0 (dart-lang/web_socket_channel#306)
NotTsunami d6dca34
adjust the HtmlWebSocketChannel ctor parameter type; rev to 2.4.3 (da…
devoncarew 3fff2ae
Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (dart-lang/web_socket_c…
dependabot[bot] 6ed1dfe
Require Dart 3.3 and the latest pkg:web (dart-lang/web_socket_channel…
kevmoo dfc1abb
Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/web_socket_chann…
dependabot[bot] ccfa26f
use secure random number generator (dart-lang/web_socket_channel#334)…
danielgrad 01817d2
Create an adapter for `package:web_socket` (dart-lang/web_socket_chan…
brianquinlan 510f396
Remove WebSocketChannel constructor (dart-lang/web_socket_channel#341)
brianquinlan c0ea76f
Implement IOWebSocketChannel as a WebSocketAdapterWebSocket subclass …
brianquinlan 816e120
Rename WebSocketAdapterWebSocketChannel to AdapterWebSocketChannel (d…
brianquinlan d0940e6
Avoid importing io_web_socket namespace (dart-lang/web_socket_channel…
brianquinlan bf9965c
Fix a race when close() called before remote class event delivered (d…
brianquinlan e5b9efb
Bump dart-lang/setup-dart from 1.6.2 to 1.6.4 (dart-lang/web_socket_c…
dependabot[bot] 0af8fbf
Bump actions/checkout from 4.1.2 to 4.1.4 (dart-lang/web_socket_chann…
dependabot[bot] c6af40c
Remove "wip" label for 3.0 release (dart-lang/web_socket_channel#347)
brianquinlan f84ac26
Make shelf_web_socket a dev dependency (dart-lang/web_socket_channel#…
brianquinlan d69a0b2
Remove dependency_overrides (dart-lang/web_socket_channel#354)
brianquinlan 7739a5f
blast_repo fixes (dart-lang/web_socket_channel#359)
devoncarew 9c7a42b
Bump actions/checkout from 4.1.4 to 4.1.5 in the github-actions group…
dependabot[bot] f7fd087
Remove obsolete `WebSocketChannel.new` documentation. (dart-lang/web_…
brianquinlan 6ef94db
Bump and fix lints (dart-lang/web_socket_channel#366)
kevmoo 1009766
Add `topics` to `pubspec.yaml` (dart-lang/web_socket_channel#362)
szakarias 4e2d823
Remove `--fatal-infos` from `dart pub downgrade` analysis (dart-lang/…
brianquinlan 6740e2f
Bump actions/checkout from 4.1.5 to 4.1.6 in the github-actions group…
dependabot[bot] e34a16e
bump web_socket dependency 0.1.3 -> 0.1.5 (dart-lang/web_socket_chann…
tempo-riz 55ec98c
Bump the github-actions group with 2 updates (dart-lang/web_socket_ch…
dependabot[bot] 1ab212a
Support latest pkg:web, prepare release (dart-lang/web_socket_channel…
kevmoo 5570c4b
Bump actions/checkout from 4.1.7 to 4.2.0 in the github-actions group…
dependabot[bot] 8564103
blast_repo fixes (dart-lang/web_socket_channel#385)
kevmoo 1cfa990
Bump actions/checkout from 4.2.0 to 4.2.2 in the github-actions group…
dependabot[bot] 2e21115
Bump dart-lang/setup-dart in the github-actions group (dart-lang/web_…
dependabot[bot] 79db766
Merge package:web_socket_channel into the http monorepo
mosuem 7bd6dfc
Add issue template and other fixes
mosuem 1312034
Moving fixes
mosuem 40a83eb
Merge branch 'master' into merge-web_socket_channel-package
mosuem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
name: "package:web_socket_channel" | ||
about: "Create a bug or file a feature request against package:web_socket_channel." | ||
labels: "package:web_socket_channel" | ||
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: package:web_socket_channel | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- '.github/workflows/web_socket_channel.yaml' | ||
- 'pkgs/web_socket_channel/**' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/web_socket_channel.yaml' | ||
mosuem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 'pkgs/web_socket_channel/**' | ||
schedule: | ||
- cron: "0 0 * * 0" | ||
|
||
defaults: | ||
run: | ||
working-directory: pkgs/web_socket_channel/ | ||
|
||
env: | ||
PUB_ENVIRONMENT: bot.github | ||
|
||
jobs: | ||
# Check code formatting and static analysis on a single OS (linux) | ||
# against Dart dev. | ||
analyze: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
sdk: [dev] | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 | ||
with: | ||
sdk: ${{ matrix.sdk }} | ||
- id: install | ||
name: Install dependencies | ||
run: dart pub get | ||
- name: Check formatting | ||
run: dart format --output=none --set-exit-if-changed . | ||
if: always() && steps.install.outcome == 'success' | ||
- name: Analyze code | ||
run: dart analyze | ||
if: always() && steps.install.outcome == 'success' | ||
|
||
test: | ||
needs: analyze | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
sdk: [3.3, dev] | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 | ||
with: | ||
sdk: ${{ matrix.sdk }} | ||
- id: install | ||
name: Install dependencies | ||
run: dart pub get | ||
- name: Run VM tests | ||
run: dart test --platform vm | ||
if: always() && steps.install.outcome == 'success' | ||
- name: Run Chrome tests | ||
run: dart test --platform chrome | ||
if: always() && steps.install.outcome == 'success' | ||
- name: Run Chrome tests - wasm | ||
run: dart test --platform chrome --compiler dart2wasm | ||
if: always() && steps.install.outcome == 'success' && matrix.sdk == 'dev' | ||
|
||
# Run analysis against the oldest supported pub constraints. | ||
downgrade: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 | ||
- run: dart pub downgrade | ||
- run: dart analyze |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.dart_tool/ | ||
.packages | ||
pubspec.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
## 3.0.2 | ||
|
||
- Move to `dart-lang/http` monorepo. | ||
|
||
## 3.0.1 | ||
|
||
- Remove unnecessary `dependency_overrides`. | ||
- Remove obsolete documentation for `WebSocketChannel.new`. | ||
- Update package `web: '>=0.5.0 <2.0.0'`. | ||
|
||
## 3.0.0 | ||
|
||
- Provide an adapter around `package:web_socket` `WebSocket`s and make it the | ||
default implementation for `WebSocketChannel.connect`. | ||
- **BREAKING**: Remove `WebSocketChannel` constructor. | ||
- **BREAKING**: Make `WebSocketChannel` an `abstract interface`. | ||
- **BREAKING**: `IOWebSocketChannel.ready` will throw | ||
`WebSocketChannelException` instead of `WebSocketException`. | ||
|
||
## 2.4.5 | ||
|
||
- use secure random number generator for frame masking. | ||
|
||
## 2.4.4 | ||
|
||
- Require Dart `^3.3` | ||
- Require `package:web` `^0.5.0`. | ||
|
||
## 2.4.3 | ||
|
||
- `HtmlWebSocketChannel`: Relax the type of the websocket parameter to the | ||
constructor in order to mitigate a breaking change introduced in `2.4.1`. | ||
|
||
## 2.4.2 (retracted) | ||
|
||
- Allow `web: '>=0.3.0 <0.5.0'` | ||
|
||
## 2.4.1 | ||
|
||
- Update the examples to use `WebSocketChannel.ready` and clarify that | ||
`WebSocketChannel.ready` should be awaited before sending data over the | ||
`WebSocketChannel`. | ||
- Mention `ready` in the docs for `connect`. | ||
- Bump minimum Dart version to 3.2.0 | ||
- Move to `pkg:web` to support WebAssembly compilation. | ||
|
||
## 2.4.0 | ||
|
||
- Add a `customClient` parameter to the `IOWebSocketChannel.connect` factory, | ||
which allows the user to provide a custom `HttpClient` instance to use for the | ||
WebSocket connection | ||
- Bump minimum Dart version to 2.15.0 | ||
|
||
## 2.3.0 | ||
|
||
- Added a Future `ready` property to `WebSocketChannel`, which completes when | ||
the connection is established | ||
- Added a `connectTimeout` parameter to the `IOWebSocketChannel.connect` factory, | ||
which controls the timeout of the WebSocket Future. | ||
- Use platform agnostic code in README example. | ||
|
||
## 2.2.0 | ||
|
||
- Add `HtmlWebSocketChannel.innerWebSocket` getter to access features not exposed | ||
through the shared `WebSocketChannel` interface. | ||
|
||
## 2.1.0 | ||
|
||
- Add `IOWebSocketChannel.innerWebSocket` getter to access features not exposed | ||
through the shared `WebSocketChannel` interface. | ||
|
||
## 2.0.0 | ||
|
||
- Support null safety. | ||
- Require Dart 2.12. | ||
|
||
## 1.2.0 | ||
|
||
* Add `protocols` argument to `WebSocketChannel.connect`. See the docs for | ||
`WebSocket.connet`. | ||
* Allow the latest crypto release (`3.x`). | ||
|
||
## 1.1.0 | ||
|
||
* Add `WebSocketChannel.connect` factory constructor supporting platform | ||
independent creation of WebSockets providing the lowest common denominator | ||
of support on dart:io and dart:html. | ||
|
||
## 1.0.15 | ||
|
||
* bug fix don't pass protocols parameter to WebSocket. | ||
|
||
## 1.0.14 | ||
|
||
* Updates to handle `Socket implements Stream<Uint8List>` | ||
|
||
## 1.0.13 | ||
|
||
* Internal changes for consistency with the Dart SDK. | ||
|
||
## 1.0.12 | ||
|
||
* Allow `stream_channel` version 2.x | ||
|
||
## 1.0.11 | ||
|
||
* Fixed description in pubspec. | ||
|
||
* Fixed lints in README.md. | ||
|
||
## 1.0.10 | ||
|
||
* Fixed links in README.md. | ||
|
||
* Added an example. | ||
|
||
* Fixed analysis lints that affected package score. | ||
|
||
## 1.0.9 | ||
|
||
* Set max SDK version to `<3.0.0`. | ||
|
||
## 1.0.8 | ||
|
||
* Remove use of deprecated constant name. | ||
|
||
## 1.0.7 | ||
|
||
* Support the latest dev SDK. | ||
|
||
## 1.0.6 | ||
|
||
* Declare support for `async` 2.0.0. | ||
|
||
## 1.0.5 | ||
|
||
* Increase the SDK version constraint to `<2.0.0-dev.infinity`. | ||
|
||
## 1.0.4 | ||
|
||
* Support `crypto` 2.0.0. | ||
|
||
## 1.0.3 | ||
|
||
* Fix all strong-mode errors and warnings. | ||
|
||
* Fix a bug where `HtmlWebSocketChannel.close()` would crash on non-Dartium | ||
browsers if the close code and reason weren't provided explicitly. | ||
|
||
## 1.0.2 | ||
|
||
* Properly use `BASE64` from `dart:convert` rather than `crypto`. | ||
|
||
## 1.0.1 | ||
|
||
* Add support for `crypto` 1.0.0. | ||
|
||
## 1.0.0 | ||
|
||
* Initial version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright 2016, the Dart project authors. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. | ||
* Neither the name of Google LLC nor the names of its | ||
contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
[](https://pub.dev/packages/web_socket_channel) | ||
[](https://pub.dev/packages/web_socket_channel/publisher) | ||
|
||
`package:web_socket_channel` provides cross-platform | ||
[`StreamChannel`][stream_channel] wrappers for WebSocket connections. | ||
|
||
## Docs and Usage | ||
|
||
It provides a cross-platform | ||
[`WebSocketChannel`][WebSocketChannel] API, a cross-platform implementation of | ||
that API that communicates over an underlying [`StreamChannel`][stream_channel], | ||
[an implementation][IOWebSocketChannel] that wraps `dart:io`'s `WebSocket` | ||
class, and [a similar implementation][HtmlWebSocketChannel] that wraps | ||
`dart:html`'s. | ||
|
||
[stream_channel]: https://pub.dev/packages/stream_channel | ||
[WebSocketChannel]: https://pub.dev/documentation/web_socket_channel/latest/web_socket_channel/WebSocketChannel-class.html | ||
[IOWebSocketChannel]: https://pub.dev/documentation/web_socket_channel/latest/web_socket_channel.io/IOWebSocketChannel-class.html | ||
[HtmlWebSocketChannel]: https://pub.dev/documentation/web_socket_channel/latest/web_socket_channel.html/HtmlWebSocketChannel-class.html | ||
|
||
It also provides constants for the WebSocket protocol's pre-defined status codes | ||
in the [`status.dart` library][status]. It's strongly recommended that users | ||
import this library with the prefix `status`. | ||
|
||
[status]: https://pub.dev/documentation/web_socket_channel/latest/status/status-library.html | ||
|
||
```dart | ||
import 'package:web_socket_channel/web_socket_channel.dart'; | ||
import 'package:web_socket_channel/status.dart' as status; | ||
|
||
main() async { | ||
final wsUrl = Uri.parse('ws://example.com'); | ||
final channel = WebSocketChannel.connect(wsUrl); | ||
|
||
await channel.ready; | ||
|
||
channel.stream.listen((message) { | ||
channel.sink.add('received!'); | ||
channel.sink.close(status.goingAway); | ||
}); | ||
} | ||
``` | ||
|
||
## `WebSocketChannel` | ||
|
||
The [`WebSocketChannel`][WebSocketChannel] class's most important role is as the | ||
interface for WebSocket stream channels across all implementations and all | ||
platforms. In addition to the base `StreamChannel` interface, it adds a | ||
[`protocol`][protocol] getter that returns the negotiated protocol for the | ||
socket, as well as [`closeCode`][closeCode] and [`closeReason`][closeReason] | ||
getters that provide information about why the socket closed. | ||
|
||
[protocol]: https://pub.dev/documentation/web_socket_channel/latest/web_socket_channel/WebSocketChannel/protocol.html | ||
[closeCode]: https://pub.dev/documentation/web_socket_channel/latest/web_socket_channel/WebSocketChannel/closeCode.html | ||
[closeReason]: https://pub.dev/documentation/web_socket_channel/latest/web_socket_channel/WebSocketChannel/closeReason.html | ||
|
||
The channel's [`sink` property][sink] is also special. It returns a | ||
[`WebSocketSink`][WebSocketSink], which is just like a `StreamSink` except that | ||
its [`close()`][sink.close] method supports optional `closeCode` and | ||
`closeReason` parameters. These parameters allow the caller to signal to the | ||
other socket exactly why they're closing the connection. | ||
|
||
[sink]: https://pub.dev/documentation/web_socket_channel/latest/web_socket_channel/WebSocketChannel/sink.html | ||
[WebSocketSink]: https://pub.dev/documentation/web_socket_channel/latest/web_socket_channel/WebSocketSink-class.html | ||
[sink.close]: https://pub.dev/documentation/web_socket_channel/latest/web_socket_channel/WebSocketSink/close.html | ||
|
||
`WebSocketChannel` also works as a cross-platform implementation of the | ||
WebSocket protocol. The [`WebSocketChannel.connect` constructor][connect] | ||
connects to a listening server using the appropriate implementation for the | ||
platform. | ||
|
||
[connect]: https://pub.dev/documentation/web_socket_channel/latest/web_socket_channel/WebSocketChannel/WebSocketChannel.connect.html |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.