server-sent-events

Jersey SSE client is not receiving events

你离开我真会死。 提交于 2019-12-21 22:45:27
问题 I have written a rudimentary Java application to consume SSE (server-sent events) streamed from a Node.js server, using the Jersey SSE client. However, I am unable to receive the events. To verify the server component is working as expected, I used the curl as follows: curl -v -H "Accept: text/event-stream" http://localhost:8080/events/ I get the following response: * Trying ::1... * Connected to localhost (::1) port 8080 (#0) > GET /events/ HTTP/1.1 > Host: localhost:8080 > User-Agent: curl

Affects to the server from running EventSources

跟風遠走 提交于 2019-12-21 12:41:36
问题 I'm currently building a Chat just for fun. I've never done it before, and I did in in general to try out the EventSource API (Server-Sent Events) in JavaScript . I just heard of it about 3 days ago and I thought it was interesting and far easier than setting up a WebSocket . I knew that long polling uses up a lot of resource. However, since I've never heard of an EventSource, how does it affect the server? Does it use up the same amount of resource? I've noticed that in the Networks Tab of

AngularJS with Server-Sent Events

帅比萌擦擦* 提交于 2019-12-20 09:20:14
问题 I have an AngularJS app with the following controller. It worked fine with GET on regular JSON resource and manual request for updates, but I cannot make it work with Server-Sent Events. The problem I am facing is that after I receive an SSE event and set/update openListingsReport variable my view is not getting updated. I am obviously missing a very basic concept. Please help me fix this. var rpCtrl = angular.module('rpCtrl', ['rpSvc']); rpCtrl.controller('rpOpenListingsCtrl', ['$scope',

What technology does Google Drive use to get real-time updates?

若如初见. 提交于 2019-12-20 08:38:49
问题 What technology does Google Drive use to do real-time? When I type in a Google Drive document that is being accessed by multiple users, the Chrome Developer Tools Network tab shows that there are no WebSockets. I see that the two most frequent types of AJAX call have either "bind?" or "save?" in the URL. "save?" POST requests are made every time I type, which makes sense- normal AJAX for sending updates to the server. When another user types, the most recent "bind?" GET call stays open, and

What technology does Google Drive use to get real-time updates?

Deadly 提交于 2019-12-20 08:38:49
问题 What technology does Google Drive use to do real-time? When I type in a Google Drive document that is being accessed by multiple users, the Chrome Developer Tools Network tab shows that there are no WebSockets. I see that the two most frequent types of AJAX call have either "bind?" or "save?" in the URL. "save?" POST requests are made every time I type, which makes sense- normal AJAX for sending updates to the server. When another user types, the most recent "bind?" GET call stays open, and

Angular using Server Sent Events in a factory

旧巷老猫 提交于 2019-12-20 06:37:21
问题 I am trying to setup message notifications in an Angular/Rails app. When the user logs in, I want to open a SSE connection which will subscribe to a Redis stream and push an alert to the client when the user gets a new message. I have my SSE setup and working, but cannot figure out a way to reliably close the SSE connection when a user logs out. I am trying to build a service to handle SSE opening and closing: angular.module('messagesApp') .factory('StreamHandler', function(CookieHandler,

Performance of event-source

怎甘沉沦 提交于 2019-12-20 02:42:24
问题 I'm currently working on a large project, which requires server-sent events implementation. I've decided to use event-source transport for it, and started from simple chat. Currently client side listens only to a new chat message event, but project will have a lot more events in the future. First of, I'm really concerned about a server-side script and loop in it, and second, I'm not sure that using mySQL database as storage(in this case, for chat messages) is actually a good practice. Current

Performance of event-source

試著忘記壹切 提交于 2019-12-20 02:42:10
问题 I'm currently working on a large project, which requires server-sent events implementation. I've decided to use event-source transport for it, and started from simple chat. Currently client side listens only to a new chat message event, but project will have a lot more events in the future. First of, I'm really concerned about a server-side script and loop in it, and second, I'm not sure that using mySQL database as storage(in this case, for chat messages) is actually a good practice. Current

How to fire EventSource SSE events?

有些话、适合烂在心里 提交于 2019-12-19 10:04:03
问题 I've recently discovered EventSource, YUI3 has a Gallery module to normalise and fallback behaviour, that's what I've chosen to go with in my example as I use that framework already. So I've searched about quite a bit, read many blogs, posts and examples, all of which show pretty much the same thing: How to set up basic SSE events. I now have 6 examples of open/message/error/close events firing. What I don't have (what I'd hoped this link was going to give me) is an example of how to fire SSE

Server Sent Event not working in Google Chrome

梦想与她 提交于 2019-12-19 03:59:41
问题 This is my server JSP code "Server_Date.jsp" <% response.setHeader("cache-control", "no-cache"); response.setContentType("text/event-stream"); out.print("data: " + (new java.util.Date()).toString() + "x\n\n"); out.flush(); %> This my client jsp page "Client_Serverdate.jsp" <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv=