New method for WebSocketBuilder taking Pipe[F, WebSocketFrame, WebSocketFrame]
See original GitHub issueWhat’s your opinion about another build method that looks like this:
def build(
pipe: Pipe[F, WebSocketFrame, WebSocketFrame]
headers: Headers = Headers.empty,
onNonWebSocketRequest: F[Response[F]] =
Response[F](Status.NotImplemented).withEntity("This is a WebSocket route.").pure[F],
onHandshakeFailure: F[Response[F]] = Response[F](Status.BadRequest)
.withEntity("WebSocket handshake failed.").pure[F])
Similarly how it’s done in akka-http. I believe it is enough for many use cases of websockets, can simplify the code and it’s easier to reason about for these use cases.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
WebSocketBuilder - http4s
This method allows one to attach a message to the CloseFrame as defined by the websocket protocol.
Read more >How to Serve Web Sockets with Http4s | Stephen's Tech Blog
You get the WebSocketBuilder by using withHttpWebSocketApp on the ServerBuilder your using. Then you can serve or receive data as FS2 Streams of ......
Read more >softwaremill/sttp - Gitter
Hey All, I am using STTP client with ZIO. Currently using send method from sttp.client3.asynchttpclient.zio._ package to make the request. But when I...
Read more >Unit Testing http4s router websocket endpoints - Stack Overflow
toString) }) } val fromClient: Pipe[F, WebSocketFrame, Unit] = _. ... a websocket client, but I don't know of a way to do...
Read more >WebSocket.Builder (Java SE 11 & JDK 11 ) - Oracle Help Center
public static interface WebSocket.Builder ... The intermediate (setter-like) methods change the state of the builder and return the same builder they have ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m actually thinking that a model based on a Pipe might be cleaner than what we have now, here’s a small snippet discussing translating back and forth between the two:
From what I could get, it would be an additional builder, and yes, a
Pipe
from input to output