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

Add a WebSocket.upgrade(Stream<List<int>>, StreamSink<List<int>>) static method #44783

Open
natebosch opened this issue Jan 26, 2021 · 1 comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io

Comments

@natebosch
Copy link
Member

We currently have over a thousand lines of copy/pasted code from dart:io to have an implementation of WebSocket which does not reference any other types from dart:io like Socket.

If we remove the API from package:web_socket_channel then in the known use case we can likely import dart:io and use this proposed API instead.
dart-lang/web_socket_channel#150

I'm not sure if we'd also want it to cover some of the behavior implemented in package:shelf_web_socket around prepping the upgrade and searching for protocols - we likely do want that.

https://github.com/dart-lang/shelf_web_socket/blob/fe1ce13114bb7318e140587f21ebec4cbb127ef3/lib/src/web_socket_handler.dart#L71-L83

cc @lrhn for thoughts

@natebosch natebosch added area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io labels Jan 26, 2021
@natebosch
Copy link
Member Author

This could also help make it easier to do the upgrades from a normal socket. #34284

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io
Projects
None yet
Development

No branches or pull requests

1 participant