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

Single Receiver #248

Closed mhndev closed 7 years ago

mhndev commented 7 years ago

Hi, Is it possible to push data to a single device by any identifier? or I should push data to a channel and filter data on receivers devices? or can i have dynamic channel name by "Channels by argument"? can you explain more about "Channels by argument" and what is it's advantage?

wandenberg commented 7 years ago

Hi @mhndev currently there is no option to post message to a channel and have it delivered only to one receiver, but you can use the same connection to connect to multiple channels. As example, you can connect to a common channel and to a private channel, /sub/common_channel/user1_channel for the user_1 and /sub/common_channel/user2_channel for the user_2. While posting messate to the common_channel both users will receive it and posting to user1_channel or user2_channel only the correspondent user will receive it.

Regarding the "Channels by argument" is only a different way to tell to the server where are the channels ids that you want to subscribe. If you configure the server to get the ids from the url path, you should not use the "channels by arguments". If you configured your server to read the ids from a querystring parameter, so you have to set the "Channels by argument" flag and configure what is the name of the parameter to use. Is just a helper inside the example javascript client, no advantages or disadvantages.

mhndev commented 7 years ago

@wandenberg thanks for your quick answer , as always helped me . :+1: