i'm a newbie of nginx , and i'm using nginx like a comet server by nginx_http_push_module

i've two question:

1,how do i save the messages which recieved by nginx_http_push_module into databases ?

2,how do i get audience listing of a funnel ?

thanks~

1,how do i save the messages which recieved by nginx_http_push_module into databases ?

You need to subcribe towards the funnel you are thinking about around the server side, and store each message within the database because they arrive.

You could utilize cURL in PHP, for instance, to frequently lengthy-poll the funnel (you'll have to set a suitable timeout and also the right caching headers: If-None-Match and If-Modified-Since).

2,how do i get audience listing of a funnel ?

Side note: nginx http push module protocol is dead simple, this really is not bayeux. A customer/listener within this module is just an active HTTP connection on the customer URL. For instance, if you are using interval-polling rather than lengthy polling, you'll be counted like a customer just for the (very) small amount of time throughout once the connection is made.

For this reason a listing of audience of the funnel does not make lots of sense with this particular module.

You are able to however get the amount of active customers of the funnel by giving a GET request towards the posting URL, however i seriously doubt you could do this anything with this particular.

1 - nginx doesn't get any message from clients, only out of your application at publish url that ought to be protected.

2 - you are able to implement some javascript methods with body.onload and unload to produce a chat user list for instance.