question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to have a SSE endpoint?

See original GitHub issue

Hi, I was wondering if there is currently a good way to implement SSE using oak? I tried various hacky things like writing directly to ctx.request.serverRequest.w but it does not feel right.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
kitsonkcommented, Jun 11, 2020

Ok, the feature is there, including an example and documentation. Basically:

router.get("/sse", (ctx) => {
  const target = ctx.sendEvents();
  target.dispatchMessage({ some: "data" });
});
2reactions
kitsonkcommented, Jun 9, 2020

I have the code done, I am just writing tests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Server-Sent Events (SSE) and how to implement it?
Server sent events(SSE) is a pushing technology that enables pushing notification/message/events from the server to the client(s) via HTTP connection.
Read more >
Using server-sent events - Web APIs | MDN
The server-side script that sends events needs to respond using the MIME type text/event-stream . Each notification is sent as a block of...
Read more >
What Server-Sent Events is - and how and when to implement it
This article explores what server-sent events (SSE) is, how it works, when to use it, and key considerations and challenges to be aware...
Read more >
How to Build Real-Time Notification Service Using Server ...
The simplest implementation of the SSE endpoint in Spring can be achieved by: Specifying the produced media type as text/event-stream,; Returning Flux type, ......
Read more >
Server-Sent Events in Spring - Baeldung
To create an SSE streaming endpoint, we'll have to follow the W3C specifications and designate its MIME type as text/event-stream:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found