server-sent-events

Is it possible to use gzip compression with Server-Sent Events (SSE)?

…衆ロ難τιáo~ 提交于 2019-12-09 16:57:45
问题 I would like to know if it is possible to enable gzip compression for Server-Sent Events (SSE ; Content-Type: text/event-stream). It seems it is possible, according to this book: http://chimera.labs.oreilly.com/books/1230000000545/ch16.html But I can't find any example of SSE with gzip compression. I tried to send gzipped messages with the response header field Content-Encoding set to "gzip" without success. For experimenting around SSE, I am testing a small web application made in Python

Scala: Receiving Server-Sent-Events

╄→гoц情女王★ 提交于 2019-12-09 10:16:51
问题 Set-up: A project I am working on has a pub/sub server with an HTTP interface. Subscription works by accepting server-sent-events. curl -X GET server:port/topics/news which will be pushed whenever a message is published to the given topic URL curl -X PUT server:port/topics/news -d "Politician Lies!" Problem: I have a scala project which needs to subscribe to this pub/sub server. The Play! framework is able to handle this by using PlayWS with Enumeratee + Iteratee. Unfortunately, the PlayWS

Server sent events and browser limits

孤人 提交于 2019-12-09 04:06:54
问题 I have a web application that listens for Server Sent Events. While I was working and testing with multiple windows open, things were not working and I banged my head for several times looking in the wrong direction: eventually, I realized that the problem was concurrent connections. However I was testing a very limited number and even if I am running the test on Apache (I know, I should use node). I then, switched browser and noticed something really interesting: apparently Chrome limits

Connection close in Java Servlet and SSE

夙愿已清 提交于 2019-12-09 01:31:35
问题 I try to implement Server-Sent-Event in my Webapp with Java Serlvet on server. Is it possible to check in Servlet that connection is closed by client? The loop while(true) in Servlet is infinite even if client browser is closed. Client code function startLogSSE(lastEventId, level) { var eventSource = new EventSource("log-sse?last-event-id=" + lastEventId + "&level=" + level); eventSource.onmessage = function (event) { document.getElementById('log').innerHTML = event.data + "\n" + document

Server-Sent Events with Nginx and uWSGI

你离开我真会死。 提交于 2019-12-08 18:11:03
问题 Is it possible to use server-sent events from a python/Flask application that is behind uWSGI and Nginx? I've found packages that implement SSE in python/Flask, but they seem to all do so using gevent and greenlets. https://github.com/DazWorrall/flask-sse Thanks! 回答1: can't you simply use gevent with uWSGI ? Generally this kind of technologies should be used with async engines as the multithread/multiprocess paradigm would be too much costly. 回答2: Recent versions of uWSGI (from 1.9) have

SSE Client request which does not terminate c#

柔情痞子 提交于 2019-12-08 08:45:28
问题 I am using C# to connect to a web service. I am need to send a GET request to monitor some transactions, and the web service will be sending the transactions to me continuously without breaking the connection. The web service provider said I need to connect to them with a http library that supports SSE. I have tried using HttpWebRequest and HttpClient to send request and receive response, but both of my attempt failed. I don't get response from the web service. My question is: The web service

Has viewing an EventSource in Real-Time in Chrome using the browser been deprecated?

心已入冬 提交于 2019-12-08 08:21:48
问题 Last year (approx June) I wrote an internal how-to on HTML5 Event Sources that showed viewing the event stream data in Chrome in the browser, updating in real-time. The output was similar to this: Event: my-event-name Data: {"my-data"} Event: my-event-name Data: {"my-data"} Event: my-event-name Data: {"my-data"} Now when I open it in the latest version of Chrome this no longer works (but the application that reads the event source still works). ie I get a blank screen when I browse to the

Server-Sent Event with Jersey and weblogic

强颜欢笑 提交于 2019-12-08 07:00:48
问题 I am experimenting with server sent event. Am following this link https://jersey.java.net/documentation/latest/user-guide.html#d0e8376. When I make request to the resource representing Server Sent Event, I get 500 Internal server error. According to following error, I have to register the body writer for org.glassfish.jersey.media.sse.EventOutput. But, how to do it? ####<21 Nov, 2013 3:17:28 PM IST> <Error> <com.sun.jersey.spi.container.ContainerResponse> <Laptop1> <AdminServer> <[ACTIVE]

How to select EventSource timeout value

混江龙づ霸主 提交于 2019-12-08 05:52:24
问题 In most libraries there is timeout parameter for SSE connection which is usually set to 1 second or to infinity by default. This means, that server will close SSE connection in 1 second, and client after that should reconnect again. What i should take into account selecting the value for SSE connection timeout ? Why not set it to 10 minutes or 24 hours for example ? 来源: https://stackoverflow.com/questions/57325517/how-to-select-eventsource-timeout-value

Using Server Sent Events with express

这一生的挚爱 提交于 2019-12-08 03:00:23
问题 I'll try to make this as simple as possible so i'm not having to post a ton of code. Heres what my app does right now: User uploads an audio file from the browser That file is processed on my server, this process takes some time and has about 8 or so steps to complete. Once everything is finished, the user gets feedback in the browser that the process is complete. What I want to add to this, is after every step in the process that is completed, send some data back to the server. For example: