Skip to content

Commit

Permalink
Ready cupertino_http for release with WebSocket support (#1158)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianquinlan authored Mar 22, 2024
1 parent 988b4d4 commit 051482a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 3 additions & 1 deletion pkgs/cupertino_http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## 1.3.1-wip
## 1.4.0

* **Experimental** support for the `package:web_socket` `WebSocket` interface.

## 1.3.0

Expand Down
6 changes: 6 additions & 0 deletions pkgs/cupertino_http/lib/src/cupertino_web_socket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class ConnectionException extends WebSocketException {

/// A [WebSocket] implemented using the
/// [NSURLSessionWebSocketTask API](https://developer.apple.com/documentation/foundation/nsurlsessionwebsockettask).
///
/// NOTE: the [WebSocket] interface is currently experimental and may change in
/// the future.
class CupertinoWebSocket implements WebSocket {
/// Create a new WebSocket connection using the
/// [NSURLSessionWebSocketTask API](https://developer.apple.com/documentation/foundation/nsurlsessionwebsockettask).
Expand All @@ -31,6 +34,9 @@ class CupertinoWebSocket implements WebSocket {
/// 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).
///
/// NOTE: the [WebSocket] interface is currently experimental and may change
/// in the future.
static Future<CupertinoWebSocket> connect(Uri url,
{Iterable<String>? protocols, URLSessionConfiguration? config}) async {
if (!url.isScheme('ws') && !url.isScheme('wss')) {
Expand Down
7 changes: 2 additions & 5 deletions pkgs/cupertino_http/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: cupertino_http
version: 1.4.0-wip
publish_to: none # Do not merge with this here!

version: 1.4.0
description: >-
A macOS/iOS Flutter plugin that provides access to the Foundation URL
Loading System.
Expand All @@ -17,8 +15,7 @@ dependencies:
flutter:
sdk: flutter
http: ^1.2.0
web_socket:
path: ../web_socket
web_socket: ^0.1.0

dev_dependencies:
dart_flutter_team_lints: ^2.0.0
Expand Down
3 changes: 1 addition & 2 deletions pkgs/web_socket_conformance_tests/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ dependencies:
dart_style: ^2.3.4
stream_channel: ^2.1.2
test: ^1.24.0
web_socket:
path: ../web_socket
web_socket: ^0.1.0

dev_dependencies:
dart_flutter_team_lints: ^2.0.0

0 comments on commit 051482a

Please sign in to comment.