4

I'm a little confused on how APE (Ajax Push Engine) works.

  1. How do you know which connection to push to, making sure the user is correct, from a PHP application?
  2. Is it a Apache extension? Independent server? ETc...

Some explanations would be awesome, thanks!

Robert Ross
  • 1,895
  • 2
  • 23
  • 32

2 Answers2

5

APE uses a independent HTTP/Comet server that allows, for example, long-polling. It needs some configuration made to the Apache server running beside it. It uses as server-side javascript framework for the development of modules.

On the client side of things it uses a javascript framework that receives information sent by the APE server, handles data, and send back the users requests. When the page is loaded a new client is created with var client = new APE.Client(); and from then on the client is connected to the server.

More information here

Jose Almeida
  • 108
  • 2
  • 9
1

Regarding 1) You cannot "push to a user" directly.

What you can do from PHP is called "inline push". Basically you need to call a command FROM PHP on the APE server, passing the information that you want to post ALONG with som information for the APE server WHOM to push the data to.

This requires you to keep track of your logged in users on the APE server (preferably via username/login). APE itself does not have any information about the login of connected users, you need to create some functions to do so.

A blog post that around that topic can be found here: http://www.xosofox.de/2010/10/ape-user-handling/

Xosofox
  • 840
  • 1
  • 7
  • 21