Comet application (also known as "Push server") written in php, using Ajax with the long polling technology which is the most popular technique in the Comet Programming. It provides a simple way to allow http server to push data to browser without using the classic Periodic refresh approach.
CometServer includes tow main components:
- Comet server (or Push server):
Based on AF_UNIX socket for local communication protocol family and InterProcess Communication, the server is designed to transcend the remote socket limitation that require to allocate port on server which is not allowed by many web hosting service.
- Comet client:
Tool to make communication easier between server daemon and http server.
- Operating system: Unix-like
- php version 5.3 or higher
- php libraries : posix, pcntl, xml
- php command language interface
- jQuery FW if you will use the native Comet helper "Comet\Web\JsHelper.php".
download application
$ git clone git://github.com/AliHichem/CometServer.git CometServer
install dependencies
$ git submodule update --init
add execution to "Comet"
$ chmod a+x CometServer/Comet
make "CometServer" folder writable
$ chmod a+w -R CometServer
Available commands are : start/stop/status/write/read/dump/help use help to get more informations.
start server
$ ./Comet start
depending on what you want to do with your CometServer, you may have to include CometServer classes to your web project:
<?php require_once "path_to_lib_folder_of_cometserver/config/bootstrap.php"; ?>
There is already a good example under "examples" that demonstrate how to communicate with CometServer from your Http server, see jGrowl_notifier.