Defines a location as a source of statistics. You can use this location to get statistics about a specific, group or all channels, in a resumed ou summarized way.
To get statistics about all channels in a summarized way you have to make a GET in this location without specify a name in the push_stream_channels_path directive.
To get statistics about all channels in a detailed way you have to specify "ALL" in the push_stream_channels_path.
To get statistics about prefixed channels in a detailed way you have to specify "_prefix_*" in the push_stream_channels_path.
To get statistics about a channel you have to specify the name in the push_stream_channels_path.
Defines a location as a source of statistics. You can use this location to get statistics about a specific, group or all channels, in a resumed or summarized way.
To get statistics about:
- all channels in a summarized way, you have to make a GET in this location without specify a name in the push_stream_channels_path directive.
- all channels in a detailed way, you have to specify "ALL" in the push_stream_channels_path.
- prefixed channels in a detailed way, you have to specify "_prefix_ *" in the push_stream_channels_path.
- a channel, you have to specify the name in the push_stream_channels_path.
- some channels, you have to specify their names in the push_stream_channels_path.
You can get statistics in the formats plain, xml, yaml and json. The default is json, to change this behavior you can use *Accept* header parameter passing values like "text/plain", "application/xml", "application/yaml" and "application/json" respectivelly.
You can get statistics in the formats plain, xml, yaml and json. The default is json, to change this behavior you can use *Accept* header parameter passing values like "text/plain", "application/xml", "application/yaml" and "application/json" respectively.
<pre>
location /channels-stats {
...
...
@@ -26,4 +28,5 @@ You can get statistics in the formats plain, xml, yaml and json. The default is
# /channels-stats?id=ALL -> get statistics about all channels in a detailed way
# /channels-stats?id=channel_* -> get statistics about all channels which starts with 'channel_'
# /channels-stats?id=channel_id -> get statistics about a channel
# /channels-stats?id=channel_id_1/channel_id_5 -> get statistics about some channels
The size of the memory chunk this module will use to store published messages, channels and other shared structures.
When this memory is full any new request for publish a message or subscribe a channel will receive an 500 Internal Server Error response.
If you have more than one http block on same Nginx instance and do not want they share the same memory, you can set different names to each one with the optional argument _name_.
The length of time after what a channel will be considered inactive, counted after the last message was published on it or the last subscriber leave it.
The length of time after what a channel will be considered inactive, counted after the last message was published on it or the last subscriber entered on it.
After this time the channel will no longer be available and will be moved to the trash queue.
When the "push_stream_authorized_channels_only":push_stream_authorized_channels_only is set to on, the inactivity time is only used to know when the channel should be moved to trash.
@@ -132,4 +134,4 @@ The string prefix used to identify a wildcard channel, example: when you set thi
A wildcard channel is technically equals to a normal one. It is intended to be used when the "push_stream_authorized_channels_only":push_stream_authorized_channels_only is set to on.
Defines a location as a message publisher. Requests to a publisher location are treated as messages to be sent to subscribers.
This location supports three http methods:
This location supports the following http methods:
GET, make possible to get statistics about the channel
POST, publish a message to the channel
POST/PUT, publish a message to the channel
DELETE, remove any existent stored messages, disconnect any subscriber, and delete the channel. Available only if _admin_ value is used in this directive.
Defines a location as a subscriber. This location represents a subscriber's interface to a channel's message queue.
This location only supports GET http method to receive published messages.
And has three possible values to set push mode: streaming, polling, long-polling. The default values is streaming.
The polling and long-polling modes could be set by the request header *X-Nginx-PushStream-Mode* overriding push_stream_subscriber directive value.
The eventsource mode enable "Event Source":eventsource_ref support for subscribers. Using headers Event-ID and Event-Type on publish is possible to set values to _id:_ and _event:_ attributes on message sent to subscribers.
The polling and long-polling modes could be set by the request header *X-Nginx-PushStream-Mode* overriding push_stream_subscriber directive value, except for websocket.
The eventsource mode enable "Event Source":eventsource_ref support for subscribers, using the headers Event-ID and Event-Type on publish is possible to set values to _id:_ and _event:_ attributes on message sent to subscribers.
The websocket mode enable subscriber to use WebSocket protocol.
...
...
@@ -75,9 +74,8 @@ A string representing a set of channels id and backtrack desired messages separa
The backtrack means the amount of old messages from each of the channels that will be delivered to the subscriber. On the example will be 3 messages from channel1, 5 from channel2 and 2 from channel3.
Backtrack isn't needed, you can only sign channels without get old messages, or you can mix things.
The length of time a subscriber will stay connected before it is considered expired and disconnected. If you do not want subscribers to be automatically disconnected, just not set this directive.
But, this operation is very important to help Nginx recycle memory consumed to send messages to susbscriber, allocated at pool request.
The length of time a long polling subscriber will stay connected waiting for a message before it is disconnected. If you do not want subscribers to be automatically disconnected, just not set this directive and push_stream_longpolling_connection_ttl directive.
But, this operation is very important to help Nginx recycle memory consumed to send messages to susbscriber, allocated at pool request.
Enable a WebSocket subscriber send messages to the channel it is connected (the first, if connected in more than one) through the same connection it is receiving the messages, using _send_ method from WebSocket interface.
Enable a WebSocket subscriber send messages to the channel(s) it is connected through the same connection it is receiving the messages, using _send_ method from WebSocket interface.
Set the time when last message was received to the server knows which messages has to be sent to subscriber. Is a replacement for If-Modified-Since header. Example, $arg_time indicate that the value will be take from time argument.
Set the time when last message was received. With that the server knows which messages has to be sent to subscriber. Is a replacement for If-Modified-Since header. Example, $arg_time indicate that the value will be taken from time argument.
Set the tag of the last message received to the server knows which messages has to be sent to subscriber. Is a replacement for If-None-Match header. Example, $arg_tag indicate that the value will be take from tag argument.
Set the tag of the last received message. With that the server knows which messages has to be sent to subscriber. Is a replacement for If-None-Match header. Example, $arg_tag indicate that the value will be taken from tag argument.
Set the last event id of a message to the server knows which messages has to be sent to subscriber. Is a replacement for Last-Event-Id header. Example, $arg_last_event indicate that the value will be take from last_event argument.
Set the last event id of a message. With that the server knows which messages has to be sent to subscriber. Is a replacement for Last-Event-Id header. Example, $arg_last_event indicate that the value will be taken from last_event argument.
* _push_stream_message_template_ should be exactly like as the example to be used with PushStream class
* WebSocket, EventSource and Forever iFrame may be combined setting _/ws_, _/sub_ and _/ev_ locations on same server and setting *modes: "websocket|eventsource|stream"* on client. With that if the browser supports Websocket or Event Source, it will use it, if not it will use iFrame, following the order on _modes_ attribute.
| pingtimeout | 30000 | number | the amount of time to consider that a connection does not receive a ping message (in milliseconds) |
| reconnectOnTimeoutInterval | 3000 | number | the amount of time to do a new connection after a timeout happens (in milliseconds) |
| reconnectOnChannelUnavailableInterval | 60000 | number | the amount of time to do a new connection after receives a 403, indicating that a channel is unavailable (in milliseconds) |
| secondsAgo | - | number | get messages published at less than this time, on the first connection using long polling |
| longPollingByHeaders | true | boolean | when to use time and tag values by headers instead of arguments on long polling connections |
| tagArgument | 'tag' | string | argument name to send tag value on long polling connections, specially used on JSONP mode |
| timeArgument | 'time' | string | argument name to send time value on long polling connections, specially used on JSONP mode |
| messagesPublishedAfter | - | number/date | get messages published at less than this time, on the first connection |
| lastEventId | - | string | get messages published after the message with this event id |
| messagesControlByArgument | true | boolean | when to use time and tag values by headers instead of arguments on long polling connections |
| tagArgument | 'tag' | string | argument name to send tag value, specially used on JSONP mode |
| timeArgument | 'time' | string | argument name to send time value, specially used on JSONP mode |
| eventIdArgument | 'eventid' | string | argument name to send eventid value, specially used on JSONP mode |
| useJSONP | false | boolean | when to use JSONP mode on long polling connections, mandatorily true when current domain or port is different from the target server (cross domain restrictions) |
| urlPrefixPublisher | '/pub' | string | the location prefix used to post messages |
| urlPrefixStream | '/sub' | string | the location prefix used to do Stream mode connections |