mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
## Summary Resolves #212919 We noticed that setting the header `'Content-Type': 'text/event-stream',` didn't work as the browser's native EventSource implementation. ```JS return res.ok({ headers: { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache', }, body: observableIntoEventSourceStream(events$ as unknown as Observable<ServerSentEvent>, { signal: abortController.signal, logger, }), }); ``` The reason, apparently, is that we need to flush the compressor's buffer negotiated in the HTTP request. ### How to test it: Run Kibana with examples `yarn start --no-base-path --run-examples --http2` and open the SSE example app in Kibana. You should see a clock updating every second in the UI (the clock is coming from the server). --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
common | ||
public | ||
server | ||
kibana.jsonc | ||
README.md | ||
tsconfig.json |
SSE Example
This plugin's goal is to demonstrate how to implement Server-Sent Events.