wandenberg / nginx-push-stream-module

A pure stream http push technology for your Nginx setup. Comet made easy and really scalable.
Other
2.22k stars 295 forks source link

Websocket some problems #30

Closed shenzhe closed 12 years ago

shenzhe commented 12 years ago

1 :Connect and disconnect how to broadcast other client ?

2: How to push data to the individual client?

wandenberg commented 12 years ago

Sorry, I didn't understand your questions. Could you give some examples of what are you thinking? Will be easier to help you.

shenzhe commented 12 years ago

sorry , my English is not very good for examples: in chat room , a member online , other people screen display "who coming", a member offline, other people screen display "who leave",

In addition there is a member list, can know who is online and send private chat messages to one member

wandenberg commented 12 years ago

Hi,

this module isn't a chat implementation, that is only one example of what you can do with it.

We don't have these features but you can use the module to achieve them on your application.

As example: you can connect each user to two channels, like _/sub/user_nick/chatroom.

after user connects, you send a message to _chatroom telling that _user_is online, all other users connected on _chatroom will receive this message and make a list of available users.

If one user want to send a private message to another user, it has to send a message to _usernick channel, if it want to send a message to everybody, it send to _chatroom channel.

And before the page is unloaded, or when the user click on a "sign off" button, your application may send another message to _chatroom channel telling that user is offline.

I hope this help you. I want to keep the module as generic as possible, to be used in many situations, not only for chats.

Regards, Wandenberg

On Sun, May 6, 2012 at 3:12 AM, shenzhe < reply@reply.github.com

wrote:

sorry , my English is not very good for examples: in chat room , a member online , other people screen display "who coming", a member offline, other people screen display "who leave",

In addition there is a member list, can know who is online and send private chat messages to one member


Reply to this email directly or view it on GitHub:

https://github.com/wandenberg/nginx-push-stream-module/issues/30#issuecomment-5533468

shenzhe commented 12 years ago

this idea to give me a lot of help..

thank you very much!