For questions relating to the HTML5 SSE (Server Sent Events) API; the JavaScript object is called EventSource.
Questions tagged [eventsource]
215 questions
3
votes
1 answer
What HTTP Method does EventSource use to open a connection?
While in other questions people claimt EventSource is fairly well documented I have found it to be more implied then explicit in some cases.
My understanding is that when you initialise an EventSource object in JS it opens a connection to your…

CS Dude
- 421
- 4
- 14
3
votes
0 answers
SseEmitter MessageBodyWriter not found for media type=text/event-stream
I am trying to get server-sent events working with a JavaScript web client and a Spring Boot 1.5.7 application. I get the following error in the server log when the SseEmitter is returned from the REST endpoint when the client initially…

Ens
- 308
- 3
- 15
3
votes
1 answer
c# PushStreamContent flush bug?
Did anyone of you tried to use PushStreamContent with WebApi?
I've noticed strange behavior.
Here is my code ( crappy one I know - Just Testing )
public class MsgModel
{
public MsgModel()
{
this.date =…

bunny1985
- 762
- 6
- 21
3
votes
2 answers
Is it reliable to use EventSource to get User's online status?
I have used an EventSource method to get online status of active users on my website.
In this following JavaScript code is inserted in every page
var source = new EventSource("set_online.php");
Thus this code is executing set_online.php file…

Observer
- 345
- 1
- 4
- 21
3
votes
1 answer
.Net: subclassing subclasses of EventSource
I have a C# solution which spans many, many projects. I created a tracing class that inherits from Systme.Diagnostics.Tracing.EventSource, called MyCustomEventSource, which handles most of my tracing events. I want to create subclasses of this class…

user884248
- 2,134
- 3
- 32
- 57
3
votes
1 answer
PHP and events - flush to client does not happen until the script dies
I am trying to create a simple page that sends events to a web page but I cannot get the PHP to send the output before the page terminates.
I am using PHP-FPM and php5.6.27.
this is my simple HTML page:
test…

Fabrizio
- 3,734
- 2
- 29
- 32
3
votes
2 answers
how to include yaffle event source polyfill
https://github.com/Yaffle/EventSource
I used the above because I want to get promises to work in IE11, I have installed it with npm but not sure how I'm suppose to implement it. I tried import event-source-polyfill in my js file but that hasn't…

stackjlei
- 9,485
- 18
- 65
- 113
3
votes
1 answer
Prevent Chrome to send multiple server-sent requests
I have an endpoint that accepts text/event-stream, it basically sends two different types of events: stats and result. When the server sends result event and closes the connection.
The problem is that the browser retries the connection because of…

burak emre
- 1,501
- 4
- 22
- 46
3
votes
1 answer
how to subscribe to eventstream - serverside
I have a url that return text/event-stream data so I am trying to connect and print everything I find:
var url = "..."
var source = new EventSource(url);
source.addEventListener('message', function(e) {
console.log(e.data);
},…

john mangual
- 7,718
- 13
- 56
- 95
2
votes
1 answer
Symfony / Mercure / JS EventSource don't send cookie
I've been blocking this issue for 2 days now. I'm trying to set up authentication for Mercure so that a customer can subscribe to "private" hubs. So I configured my environment variables as stipulated in the Symfony and Mercury documentation here…

Stollpy
- 35
- 6
2
votes
1 answer
How do I flush to event stream, when res.flush() does not work? (node.js)
I use express and node.js
I have been working a long time on getting a loading bar to work, and I finally figured out to use res.flush() since res.write() does not work due to compression middle-ware (to my understanding).
Now when I uploaded it to…

Peter Rosenberg
- 41
- 1
- 5
2
votes
0 answers
Istio ingress gateway configuration for EventSource
I am using Spring SSEEventEmitter library to publish events from server-side to client. Clients will subscribe for the event in first call and listen to server sent events.
I have deployed the application on Kubernetes which is enabled with Istio.…
2
votes
2 answers
Server Sent Event not working:: Error:: net::ERR_INCOMPLETE_CHUNKED_ENCODING 200
I have been trying to get basic server sent events up and running using following code(nodejs+express for backend and React on frontend), however the onmessage is not triggering when i try to update the count through terminal.
Here is the flow:
Get…

Rakesh_Kumar
- 1,442
- 1
- 14
- 30
2
votes
1 answer
SSE/Redis - how to recover messages sent when SSE goes offline
On a website I have a very simple Live chat setup that uses SSE/Redis and pub/sub structure.
The basic setup (without going into details) is:
Client-side using EventSource
Opens SSE connection and subscribes to live events sent by SSE daemon.…

Denis
- 322
- 1
- 4
- 15
2
votes
2 answers
Why do I get many SSE request that slow down my webpage in my NUXT.js project?
I have a project implemented using NUXT.js (ssr mode). Every time I refresh pages, I got three or four sse requests (like _loading/sse) in the network console. Those sse requests are slow and would fail in the end and they cause page loading time…

James
- 157
- 1
- 6