Questions tagged [eventsource]

For questions relating to the HTML5 SSE (Server Sent Events) API; the JavaScript object is called EventSource.

215 questions
4
votes
1 answer

Data limits in server-sent events

I'm using server-sent events in order to execute queries on your database. The server streams the stats in realtime with stats events and when the query is executed, it sends result event with the data and closes the connection. You can test it with…
burak emre
  • 1,501
  • 4
  • 22
  • 46
4
votes
1 answer

EventSource with cookies using AngularJS

I've been looking at using EventSource to push server events to the client, but I need the client to be able to identify itself so it doesn't just get every event of every client. I am trying to use cookies to achieve this, but somehow the cookies…
Lachlan
  • 165
  • 1
  • 10
4
votes
1 answer

HTML5 EventSource sending multiple requests

I'm trying to implement Server Sent Events using Spring SseEmitter as described in this Youtube video. I'm able to initiate the event stream and receive the data from the server sent event. However, I can see multiple EventStream type requests fired…
11thdimension
  • 10,333
  • 4
  • 33
  • 71
4
votes
1 answer

Why is this EventSource repeatedly triggering message and error?

Client side looks like this: var es = new EventSource("http://localhost:8080"); es.addEventListener("message", function(e) { alert("e.data") //Alerts "" every couple seconds }) es.addEventListener("error", function(e) { alert("error") //Also…
digglemister
  • 1,477
  • 3
  • 16
  • 31
3
votes
1 answer

Ditto HTTP API server sent events CORS error

I installed Hono+Ditto using helm-charts, as it is described in cloud2edge. That means Hono+Ditto is running inside a minikube on my PC. I also created a connection, policy, and a device. So far everything works fine. In the next step, I just wrote…
arash javanmard
  • 1,362
  • 2
  • 17
  • 37
3
votes
1 answer

How to handle a ClosedChannelException on a reactive streams http connection closed by client EventSource.close()?

I'm following Quarkus - Getting started with Reactive guide and along the sample using Server Sent Events I struggle with the ClosedChannelException. The resteasy resource handler uses vert.x and netty under the hood and the SmallRye Mutiny library…
JanPl
  • 794
  • 6
  • 19
3
votes
1 answer

eventsource.onmessage is not invoked - flask application

I have been developing a flask application and where trying to implement SSE. Check my code below: index.py @app.route('/stream', methods=['GET']) @cross_origin() def stream(): def listenstream(): print("listening") displaytext =…
angelmaria
  • 253
  • 2
  • 10
3
votes
1 answer

SSE broken after deploying with Kubernetes and connecting via Ingress

I've a ReactJS client which uses EventStream and a golang backend which implements SSE. Everything seemed to work when I connected my browser to the backend running on localhost, as well as when my backend was running on k8s with port forwarding. As…
Alechko
  • 1,406
  • 1
  • 13
  • 27
3
votes
2 answers

SSE: 'onmessage' never gets called

I'm following the most simple tutorials on the internet about how to listen to Server-Sent Events from Javascript: var es = new EventSource('url') es.onmessage = function (e) { console.log(e.data) } But my message handlers never get called. onopen…
fiatjaf
  • 11,479
  • 5
  • 56
  • 72
3
votes
1 answer

Difference between EventSource and XMLHttpRequest for SSE

I am implementing a Server Send Event application logic. The server side is done and I'm dealing now with the client part. Everywhere I look, the JS is using an EventSource Object, which seems higly logical as it is made for it ! But which has also…
Florent Descroix
  • 579
  • 4
  • 13
3
votes
1 answer

Uninstall event source (ETW) without manifest file?

What is the best way to uninstall / delete previously installed event sources without using manifest? For example. If I have something like: [EventSource(Name = "Corporation-Module-X")] public sealed class XEventSource : EventSource { …
Zeljko
  • 250
  • 1
  • 2
  • 12
3
votes
1 answer

migration from angular 5 to angular 7

Yesterday i have migrated my application from Angular 5 to angular 7. In that process i have changed EventSource to EventSourcePolyfill as suggested while running the application. But since then i am facing a strange issue. This is what i am getting…
youi
  • 1,887
  • 5
  • 20
  • 31
3
votes
4 answers

ngFor not displaying data from Observable Event Source

In my Angular6 application I have a problem with displaying data with async ngfor. I am expecting some Server Sent Events from backend (just object with answer string field). While console.log shows that answer list from service contains answers,…
annterina
  • 173
  • 1
  • 8
3
votes
1 answer

Invalid CORS with Microsoft Edge and EventSource

I just set up a fresh new project and I want to use EventSource. I would like it to be compatible with the main browsers, including Edge. EventSource being not supported by Edge, I had to install a polyfill. My client is a vue cli application…
user7663281
3
votes
0 answers

How to mock Server Sent Events SSE aka EventSource?

In my angularjs application, I have functionality where I am using SSE in a following way. The code is in a third party library, var source = new EventSource('usr_management.php'); source.addEventListener('newuser', function(e) { // business…
1 2
3
14 15