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

can i enable multi push_stream_subscriber in one location? #130

Closed notedit closed 10 years ago

notedit commented 10 years ago

if i set push_stream_subscriber to polling, i can only use polling.

how about set push_stream_subscriber to 'streaming|polling|long-polling|eventsource|websocket', so i can use multi push_stream_subscriber, let the client decide to use which one.

wandenberg commented 10 years ago

How the client will indicate to the server which mode it want to use?

notedit commented 10 years ago

maybe we could do the same thing like sockjs does. the sockjs client will send an http request, and then the client to decide to use some mode.

wandenberg commented 10 years ago

OK, but once the client decide which mode will use how it will tell this to the server?

Nowadays you can set the location as stream and override to polling or long-polling mode setting a special header on client request.

I don't see many advantages in mix the modes on one location, since the message templates are usually different and the protocols too. This can cause more confusion than have different locations, one for each mode.

If the client have to send a querystring parameter, a header or a path to indicate which mode want to use, why not have different locations? The code and the configuration are simpler with the things as they are. ;)

If you implement an easy and clean solution to this I will have pleasure to merge your pull request.

notedit commented 10 years ago

i have digg into tornado-sockjs, there are some rules like '/prefix/websocket', '/prefix/eventsource', after the client's first request, then decide to use websocket or eventsource.

maybe the solustion is to modify the client, not the server side. i will have a look if i have some time.

wandenberg commented 10 years ago

The client already has this support. Take a look on the examples. You can set multiple configurations on the server, one to each mode and at client you set the available modes using modes : "eventsource|stream|websoocket" ...

notedit commented 10 years ago

thanks, i just missed it.