server-sent-events

How to make EventSource available inside SharedWorker in FireFox?

て烟熏妆下的殇ゞ 提交于 2020-01-20 08:08:09
问题 I am trying to implement Server-Sent Events (SSE) inside a SharedWorker. The implementation is working with no problems in Google Chrome. However, it does not work in FireFox at all. When I try get it to work in FireFox I get this error in the console. error { target: SharedWorker, isTrusted: true, message: "ReferenceError: EventSource is not defined", filename: "https://example.com/add-ons/icws/js/worker.js", lineno: 28, colno: 0, currentTarget: SharedWorker, eventPhase: 2, bubbles: false,

What is the reason of “ResponseBodyEmitter is already set complete” Exception In Spring SSE

江枫思渺然 提交于 2020-01-16 09:10:29
问题 I have a problem with Spring project whichincludes Server Sent Events. I am planning to show the status of multiple mysql inserts, as percentage. I have two programs, one of them is web service and the other talks with view layer. The problematic code is in web service layer and is called from a page that shows a progress bar which demonstrates how many percent of inserts are completed. The problem is that I get "IllegalStateException: ResponseBodyEmitter is already set complete" message in

Server Sent Events Read Json and Update Clients

柔情痞子 提交于 2020-01-15 05:29:05
问题 Currently I'm updating my client solution to SSE. It's based on Codeigniter and client using javascript. I'm new to SSE. I have done below code in Rest API controller. function server_sent_events_get() { while (true) { header('Content-Type: text/event-stream'); header('Cache-Control: no-cache'); $mac = $this->get('macaddress'); $scheduleid = $this->get('scheduleid'); $modifiedon = urldecode($this->get('modifiedon')); $device_result = $this->read_devices_xml_json($mac); $schedule_result =

Laravel 5: Use Server-Sent Events to push messages to browser

我的梦境 提交于 2020-01-12 06:00:43
问题 I've looked at This SO question and This article to try and implement Server-Sent Events in Laravel 5 . Though, between the two, I can't figure how push updates to the client based on an event. In this case, the event is a ClientException being thrown. A ClientException in my application is caused by a user made error. When one is thrown, I want to push an update to the client that populates a universal error panel. Here's what I have in my blade: <script> var source = new EventSource("{{

Is there a way to make Using server-sent events persistent?

允我心安 提交于 2020-01-11 12:48:27
问题 I need to run a script that updates the user's browser once every second. My need is a one way communication from the server to the client. To do that, I implemented server-sent events polling from my server to the user's client. The problem is that the user is allow to open multiple connection to the server "by opening multiple browser tabs" witch is a problem as it adds an overhead on the server. I would like to limit the connection that is coming from a single user to 1. Meaning a single

Signalr always falls to long polling in the production server

柔情痞子 提交于 2020-01-04 18:16:42
问题 When i host the application in the server it checks for the server side events and falls back to long polling always. The server hosting environment is Windows Server 2012 R1 and IIS 7.5 Is there anyway if we can solve this issue? https://cloud.githubusercontent.com/assets/9750273/5050991/2f4cb262-6c59-11e4-9e35-db06b432d470.png IE10, Chrome 38.0.2125.111 and Firefox.. In all the 3 browsers i am getting long polling, server sent events is cancelled. As i understand few of them had told if the

Not able to access Server-Sent-Events over Mobile 3g Network

落花浮王杯 提交于 2020-01-03 16:45:03
问题 I am having an issue with Server Sent events. My endpoint is not available on mobile 3G network. One observation I have is that a https endpoint like the one below which is available on my mobile network. https://s-dal5-nss-32.firebaseio.com/s1.json?ns=iot-switch&sse=true But the same endpoint when proxy passed using an nginx and accessed over http (without ssl) is not available on my mobile network. http://aws.arpit.me/live/s1.json?ns=iot-switch&sse=true This is available on my home/office

Not able to access Server-Sent-Events over Mobile 3g Network

只谈情不闲聊 提交于 2020-01-03 16:44:34
问题 I am having an issue with Server Sent events. My endpoint is not available on mobile 3G network. One observation I have is that a https endpoint like the one below which is available on my mobile network. https://s-dal5-nss-32.firebaseio.com/s1.json?ns=iot-switch&sse=true But the same endpoint when proxy passed using an nginx and accessed over http (without ssl) is not available on my mobile network. http://aws.arpit.me/live/s1.json?ns=iot-switch&sse=true This is available on my home/office

How Server Sent Event send response to a specific client

别等时光非礼了梦想. 提交于 2020-01-01 16:56:32
问题 In Server Sent Event, it always send the same response to all the client. but what i want to know is, How to send response to an only one client using java. this is my event which define inside sw.js (SSE) var eventSource = new EventSource("HelloServlet"); eventSource.addEventListener('up_vote',function(event){ console.log("data from s" , event.data); var title = event.data; self.registration.showNotification(title, { 'body': event.data, 'icon': 'images/icon.png' }) }); I want to show this

Server sent events work, but with a massive time delay

安稳与你 提交于 2020-01-01 09:19:17
问题 Ill start off by saying this works perfectly on my local machine, the js example below connects to stream.php and receives a continuous update of the servers current time every second. index.php var source = new EventSource("stream.php"); source.addEventListener('message', function(e) { console.log(e); }, false); source.addEventListener('open', function(e) { console.log(e); }, false); source.addEventListener('error', function(e) { if (e.readyState == EventSource.CLOSED) { console.log('closed'