s4nchez
10/05/2021, 1:48 PMval sse = sse(
"/hello" bind sse(
"/{name}" bind { sse: Sse ->
val name = sse.connectRequest.path("name")!!
sse.send(Event("event1", "hello $name", "123"))
sse.send(Event("event2", "again $name", "456"))
sse.send(Data("goodbye $name".byteInputStream()))
}
)
)
Sandymcp
10/05/2021, 1:49 PMs4nchez
10/05/2021, 1:52 PMcurl --http2 -H "Accept:text/event-stream" <http://localhost:8080/test>
Sandymcp
10/05/2021, 2:14 PM