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.

Specification for Server Sent Events / SSE

See original GitHub issue

Hi everyone,

not sure if this has been discussed already. I recently stumbled over SSE. https://en.wikipedia.org/wiki/Server-sent_events (coming from https://htmx.org/attributes/hx-sse/).

Right now it’s hard to differentiate SSE since it identifies itself as scope["type"] == "http".

Would it be possible to define scope["type"] == "sse"?

At least when considering Django, regular StreamingResponses are not a stable solution. async/await feels much better when coping with these kind of web requests (long living connections).

Best Sven

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
andrewgodwincommented, Mar 20, 2021

To answer the overall idea of this issue - there’s not really a sensible way we can separate SSE into a separate spec. It’s literally just a different way of doing streaming HTTP responses, and as such, should live under HTTP (unlike WebSockets, which are their own binary protocol).

Could there be a nice third-party library that made composing the responses easier? Absolutely. Is this something we can help at the spec level? Not really, since that would require all servers to write and compose code just for this case - a case that’s already covered with the spec anyway.

2reactions
abersheerancommented, Mar 19, 2021

By the way, I don’t think it’s a good idea to separate SSE. It is also just a normal HTTP response.

Read more comments on GitHub >

github_iconTop Results From Across the Web

9.2 Server-sent events - HTML Standard - WhatWG
To enable servers to push data to web pages over HTTP or using dedicated server-push protocols, this specification introduces the EventSource interface.
Read more >
Server-Sent Events - W3C
This specification defines an API for opening an HTTP connection for receiving push notifications from a server in the form of DOM events....
Read more >
Server-sent events - Web APIs - MDN Web Docs
Defines all the features that handle connecting to a server, receiving events/data, errors, closing a connection, etc. Examples. Simple SSE demo ...
Read more >
Server-sent events - Wikipedia
Server -Sent Events (SSE) is a server push technology enabling a client to receive automatic updates from a server via an HTTP connection,...
Read more >
Server-Sent Events Support • Akka HTTP - Documentation
According to the SSE specification clients can request an event stream from the server via HTTP. The server responds with the media type...
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