Skip to content
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

Ready cupertino_http for release with WebSocket support #1158

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading