Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you push data to a web page client?

I just learned about the AJAX Push Engine but it runs on Linux/Apache which is not an option for me.

http://www.ape-project.org/

Currently with AJAX to keep a page current I have to poll the server frequently which is not great for a high traffic site. The option to push data to the client only when necessary is a great option, but natively JavaScript does not support sockets, AFAIK. One trick I read about, but the site is now gone, is to use a Flash module to handle socket communications and relay message to JavaScript.

The trouble with researching this approach is that "JavaScript push" as keywords come up with the push function for arrays instead of the context I want.

How could establish a persistent connection with the server to do push communications in the browser? Do I need Flash/ActionScript or is there another option that would work with all of the currently active browsers? (IE6/7/8, FF3, Safari, Chrome)

When it comes to the server I also need to work out the complications due to Origin policy as well as port security. I appreciate anything you can point out that will explain the available options.

like image 423
Brennan Avatar asked Oct 15 '22 15:10

Brennan


1 Answers

What you want is COMET, or I would also look up long polling.

I asked a similar question.

like image 63
cgp Avatar answered Oct 18 '22 21:10

cgp