Specification for Server Sent Events / SSE
See original GitHub issueHi 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:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
By the way, I don’t think it’s a good idea to separate SSE. It is also just a normal HTTP response.