Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
brianquinlan committed Mar 5, 2024
1 parent a94ca1f commit 693c35c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkgs/web_socket/lib/src/browser_web_socket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ class BrowserWebSocket implements WebSocket {
final web.WebSocket _webSocket;
final _events = StreamController<WebSocketEvent>();

/// Create a new WebSocket connection using the JavaScript WebSocket API.
///
/// The URL supplied in [url] must use the scheme ws or wss.
///
/// If provided, the [protocols] argument indicates that subprotocols that
/// the peer is able to select. See
/// [RFC-6455 1.9](https://datatracker.ietf.org/doc/html/rfc6455#section-1.9).
static Future<BrowserWebSocket> connect(Uri url,
{Iterable<String>? protocols}) async {
final webSocket = web.WebSocket(url.toString(),
Expand Down
7 changes: 7 additions & 0 deletions pkgs/web_socket/lib/src/io_web_socket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ class IOWebSocket implements WebSocket {
final io.WebSocket _webSocket;
final _events = StreamController<WebSocketEvent>();

/// Create a new WebSocket connection using dart:io WebSocket.
///
/// The URL supplied in [url] must use the scheme ws or wss.
///
/// If provided, the [protocols] argument indicates that subprotocols that
/// the peer is able to select. See
/// [RFC-6455 1.9](https://datatracker.ietf.org/doc/html/rfc6455#section-1.9).
static Future<IOWebSocket> connect(Uri url,
{Iterable<String>? protocols}) async {
final io.WebSocket webSocket;
Expand Down

0 comments on commit 693c35c

Please sign in to comment.