wandenberg/nginx-push-stream-module — Issue #17: about authorized channels
Author: lockfan
Created: 2012-02-22 09:53:35+00:00
State: open

push_stream_authorized_channels_only	on;
location /pub {
push_stream_publisher	admin;
set $push_stream_channel_id $arg_id;
push_stream_keepalive	on;
}

location ~ /sub/(.*) {
push_stream_subscriber	long-polling;
set $push_stream_channels_path $1;
push_stream_longpolling_connection_ttl 30s;
push_stream_content_type "text/javascript; charset=utf-8";
}

curl -s -v -X POST 'http://127.0.0.1/pub?id=1' -d 'Hello World'
return:
{"channel": "1", "published_messages": "1", "stored_messages": "0", "subscribers": "0"}

curl -s -v 'http://127.0.0.1/sub/1'
return:
< HTTP/1.1 403 Forbidden
< Server: nginx/1.0.12
< Date: Wed, 22 Feb 2012 09:48:19 GMT
< Content-Length: 0
< Connection: keep-alive
< X-Nginx-PushStream-Explain: Subscriber could not create channels.