Usage of cupertino_http with web_socket_channel #1282
Labels
package:cupertino_http
Issues related to package:cupertino_http
type-enhancement
A request for a change that isn't a bug
Recently added cupertino web socket API uses
web_socket
package. However, there are some higher-level libraries like graphql, ferry or gql that still rely ondart:io
WebSocket
implementations viaweb_socket_channel
package.This means that the benefits coming from cupertino_http (like proxy support, observability via Xcode Instruments) cannot be leveraged there without additional work.
I'd like to request an adapter example that could let us use
CupertinoWebSocket
withweb_socket_channel
. It could be just a part of the documentation on how to usecupertino_http
withdart:io
-related packages.In my first attempt I tried to wrap CupertinoWebSocket with WebSocketChannel via StreamChannelMixin. It doesn't work but feels like relatively acceptable amount of code to be put into the documentation (assuming it works).
Is such addition to the docs possible?
Edit: I found AdapterWebSocketChannel class that can be used as follows:
Previous non working impl
Related
The text was updated successfully, but these errors were encountered: