Ember Client WebSocket support
Now that we have ember-server WebSocket support, it shouldn't be much of a lift on the backend to build client support for it. I anticipate a bit of work around user API
Besides ember-client I'd be thrilled to create e.g. a dom-websocket module implementing this as well, behind a common/shared abstraction.
https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
http4s-jdk-http-client has a WebSocket client. See WSClient.scala for the traits. We have our own WSFrame ADT there, as well es a "low level" and a "high level" interface due to differences in whether pings are automatically responded to, but these were mainly ideas/explorations.
I would be very glad to see an interface in http4s, and will happily port http4s-jdk-http-client to it!
Yes, I've taken a look at it on a couple occasions, I'd love to see that (or a similar) interface in http4s proper! I'm looking at the reference for browser web sockets and it looks like it can be used to implement your high level interface.
I'm no expert on these things, but maybe if the high-level interface is more straight forward we can start by porting that to http4s-client?
Sounds like a plan ! @amesgen whenever you have some time, could you open a branch in the http4s repo with the relevant interfaces based off series/0.22 (or whatever makes sense) ? That gives us a place to talk feasibility and design, but also get started on the ember implementation to use as another reference.
Some items I anticipate discussion around:
Client/WsClientdecoupling- Parity with existing WS server machinery
I think that a unified WebSocket interface in http4s would be huge, but it requires a lot of careful thought, and the traits from jdk-http-client should indeed only serve as a starting point. I will try to create an initial PR in the next weeks, but if anyone has more time to work on this, feel free to pick this up!
As far as I see this is not completed. However, on the table in https://http4s.org/v0.23/docs/integrations.html "Ember" is said to have "Websocket Client". Is this an error in the documentation?
@pvgoran woops, thanks for catching that, it is a mistake. A PR fixing would be much appreciated.
This is proposed as a Google Summer of Code Project! https://typelevel.org/blog/2023/02/23/gsoc.html
Hi everyone! I will be working on this for my gsoc project this summer.