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

how can i implement chat application like gmail,facebook #84

Closed pokal4u closed 11 years ago

pokal4u commented 11 years ago

Hi,

Can i implement chat application like gmail or facebook using pushstream?

A,B,C users are online I want to send message A->B only.

my code: pushstream.addChannel('A"); pushstream.addChannel('B'); pushstream.addChannel('C');
pushstream.connect(); pushstream.sendMessage('{"nick":"A","to":"B","text":"hiiii"}'); then message receive A, B and C any help? Thanks Pokal4u

wandenberg commented 11 years ago

Hi,

please, send the message just to one place, here or to the list.

To do something like that, you may create one channel to each user calling addChannel("a") only on A user, addChannel("b") only on B user and so on. Than when user B wants to send a message to user C, it send a message to channel "c", and only that user will receive. You have to implement the authentication and authorization to guarantee that only the user C is connected to the "c" channel.

Regards