server-push

HTML5 Server-Sent Events prototyping - ambiguous error and repeated polling?

别来无恙 提交于 2019-11-27 14:43:30
I'm trying to get to grips with Server-Side Events as they fit my requirements perfectly and seem like they should be simple to implement, however I can't get past a vague error and what looks like the connection repeatedly being closed and re-opened. Everything I have tried is based on this and other tutorials. The PHP is a single script: <?php header('Content-Type: text/event-stream'); header('Cache-Control: no-cache'); function sendMsg($id, $msg) { echo "id: $id" . PHP_EOL; echo "data: $msg" . PHP_EOL; echo PHP_EOL; ob_flush(); flush(); } $serverTime = time(); sendMsg($serverTime, 'server

Client notification, should I use an AJAX Push or Poll?

南笙酒味 提交于 2019-11-27 11:21:11
I am working on a simple notification service that will be used to deliver messages to the users surfing a website. The notifications do not have to be sent in real time but it might be a better user experience if they happened more frequently than say every 5 minutes. The data being sent to and from the client is not very large and it is a straight forward database query to retrieve the data. In reading other conversations on the topic it would appear that an AJAX push can result in higher server loads. Since I can tolerate longer server delays is it worth while to have the server push

Loadbalancing web sockets

霸气de小男生 提交于 2019-11-27 08:59:59
问题 I have a question about how to load balance web sockets. I have a server which supports web sockets. Browsers connect to my site and each one opens a web socket to www.mydomain.com . That way, my social network app can push messages to the clients. Traditionally, using just HTTP requests, I would scale up by adding a second server and a load balancer in front of the two web servers. With web sockets, the connection has to be directly with the web server, not the load balancers, because if a

ASP.NET Push Redirect on Session Timeout

 ̄綄美尐妖づ 提交于 2019-11-27 03:06:28
I'm looking for a tutorial, blog entry, or some help on the technique behind websites that automatically push users (ie without a postback) when the session expires. Any help is appreciated Usually, you set the session timeout, and you can additionally add a page header to automatically redirect the current page to a page where you clear the session right before the session timeout. From http://aspalliance.com/1621_Implementing_a_Session_Timeout_Page_in_ASPNET.2 namespace SessionExpirePage { public partial class Secure : System.Web.UI.MasterPage { public int SessionLengthMinutes { get { return

HTTP 2 will support server push, what does this mean?

淺唱寂寞╮ 提交于 2019-11-26 20:25:20
问题 I've read a lot of things about HTTP 2 (which is still in development), so I also heard about the server push feature, but I my head, this is not clear. Does this server push feature mean that the server will be able to send a response to the client without the latter making a request? Just like a vanilla TCP connection? Or I'm missing the point? 回答1: The HTTP2 push mechanism is not a generic server push mechanism like websocket or server sent events. It is designed for a specific

Android: Test Push Notification online (Google Cloud Messaging) [closed]

旧街凉风 提交于 2019-11-26 19:18:31
Update: GCM is deprecated, use FCM I am implementing Google Cloud Messaging in my application. Server code is not ready yet and in my environment due to some firewall restrictions I can not deploy a test sever for push notification. What I am looking for is a online server which would send some test notifications to my device to test my client implementation. Found a very easy way to do this. Open http://phpfiddle.org/ Paste following php script in box. In php script set API_ACCESS_KEY, set device ids separated by coma. Press F9 or click Run. Have fun ;) <?php // API access key from Google API

HTML5 Server-Sent Events prototyping - ambiguous error and repeated polling?

*爱你&永不变心* 提交于 2019-11-26 16:54:42
问题 I'm trying to get to grips with Server-Side Events as they fit my requirements perfectly and seem like they should be simple to implement, however I can't get past a vague error and what looks like the connection repeatedly being closed and re-opened. Everything I have tried is based on this and other tutorials. The PHP is a single script: <?php header('Content-Type: text/event-stream'); header('Cache-Control: no-cache'); function sendMsg($id, $msg) { echo "id: $id" . PHP_EOL; echo "data:

text/event-stream recognised as a download

给你一囗甜甜゛ 提交于 2019-11-26 15:38:58
问题 I'm trying to implement server push in my Flask project following this tutorial. I've set it all up with no errors, however when I go to the /stream page, Firefox recognizes it as a file and tries to download it. In Safari it just prints out the data sent. I tried adapting the code to a simpler implementation, where a thread just yields some data each second, however it produced the same results. My goal is for each time a python script reaches a point in a loop, it will update a progress bar

Client notification, should I use an AJAX Push or Poll?

爷,独闯天下 提交于 2019-11-26 15:32:14
问题 I am working on a simple notification service that will be used to deliver messages to the users surfing a website. The notifications do not have to be sent in real time but it might be a better user experience if they happened more frequently than say every 5 minutes. The data being sent to and from the client is not very large and it is a straight forward database query to retrieve the data. In reading other conversations on the topic it would appear that an AJAX push can result in higher

ASP.NET Push Redirect on Session Timeout

旧时模样 提交于 2019-11-26 10:25:35
问题 I\'m looking for a tutorial, blog entry, or some help on the technique behind websites that automatically push users (ie without a postback) when the session expires. Any help is appreciated 回答1: Usually, you set the session timeout, and you can additionally add a page header to automatically redirect the current page to a page where you clear the session right before the session timeout. From http://aspalliance.com/1621_Implementing_a_Session_Timeout_Page_in_ASPNET.2 namespace