Closed 5lava closed 10 years ago
nginx.conf:
push_stream_shared_memory_size 10M; server { location ~ /sub { push_stream_subscriber; push_stream_channels_path $arg_id; } }
Regular request (not to push-stream-module), it keeps alive:
curl --http1.0 --header "Connection: keep-alive" -v localhost/robots.txt 2>&1 | grep Connection > Connection: keep-alive < Connection: keep-alive
Request to push-stream-module to subscribe to a channel, it does not keep alive:
# curl --http1.0 --header "Connection: keep-alive" -v localhost/sub?id=123 2>&1 | grep Connection > Connection: keep-alive < Connection: close ^^^^^
Request to push-stream-module to subscribe to a channel, but don't specify channel id, cause error X-Nginx-PushStream-Explain: No channel id provided., and it keeps alive:
X-Nginx-PushStream-Explain: No channel id provided.
# curl --http1.0 --header "Connection: keep-alive" -v localhost/sub?id= 2>&1 | grep Connection > Connection: keep-alive < Connection: keep-alive
Oh, I realized that's because of chunked encoding. It's not supported in HTTP 1.0, therefore keep-alives are impossible.
nginx.conf:
Regular request (not to push-stream-module), it keeps alive:
Request to push-stream-module to subscribe to a channel, it does not keep alive:
Request to push-stream-module to subscribe to a channel, but don't specify channel id, cause error
X-Nginx-PushStream-Explain: No channel id provided.
, and it keeps alive: