Skip to content

Commit d60d2a3

Browse files
committed
Add IOWebSocketChannel.innerWebSocket
Supersedes dart-archive/web_socket_channel#141 - expose the entire `dart:io` web socket instead of selectively forwarding more parts of the interface. This does not cover the case of changing a setting immediately after the socket is connected. As a followup we may want to add a `Future<WebSocketChannel> get onConnected` to have a signal on connection and enable immediately setting options.
1 parent b8febe8 commit d60d2a3

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

pkgs/web_socket_channel/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 2.1.0-dev
2+
3+
- Add `IOWebSocketChannel.innerWebSocket` getter to access features not exposed
4+
through the shared `WebSocketChannel` interface.
5+
16
## 2.0.0
27

38
- Support null safety.

pkgs/web_socket_channel/lib/io.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ class IOWebSocketChannel extends StreamChannelMixin
3535
@override
3636
final WebSocketSink sink;
3737

38-
// TODO(nweiz): Add a compression parameter after the initial release.
38+
/// The underlying [WebSocket], if this channel has connected.
39+
///
40+
/// `If the future returned from [WebSocket.connect] has not yet completed, or
41+
/// completed as an error, this will be null.
42+
WebSocket? get innerWebSocket => _webSocket;
3943

4044
/// Creates a new WebSocket connection.
4145
///

pkgs/web_socket_channel/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: web_socket_channel
2-
version: 2.0.0
2+
version: 2.1.0-dev
33

44
description: >-
55
StreamChannel wrappers for WebSockets. Provides a cross-platform
@@ -8,7 +8,7 @@ description: >-
88
repository: https://github.com/dart-lang/web_socket_channel
99

1010
environment:
11-
sdk: ">=2.12.0-0 <3.0.0"
11+
sdk: ">=2.12.0 <3.0.0"
1212

1313
dependencies:
1414
async: ^2.5.0

0 commit comments

Comments
 (0)