Open wy193777 opened 1 month ago
That is not really a SSE, as it needs to have Content-Type: text/event-stream
.
Anyway, you should probably not use raw.res
, but rather return a Passthrough
stream that you can keep and later write the event data to. The response won’t end until the stream is closed.
Also, a Cache-Control: no-cache
header is probably appropriate.
Contributor
what's the difference between explicitly using res.end() compare to return a PassThrough?
Module version
21.3.10
What documentation problem did you notice?
There is no hapijs SSE example. I recently figured it out but don't know where to put it. So I have it here: