push_subscriber
The `push_subscriber` directive configures a location block for subscribing to push messages in the Nchan module.
Description
The push_subscriber directive is used within Nchan's configuration to define a subscription endpoint, allowing clients to listen for messages published to a specific channel. When a client connects to this endpoint, it can receive messages in real-time, making it essential for applications that require real-time data exchange, such as chat applications or live notifications. The directive enables the setup of various subscription methods including WebSocket and long polling, catering to diverse client capabilities.
Config Example
location /subscribe {
nchan_subscriber_channel_id channel_id;
push_subscriber;
}Ensure channel_id is correctly set for the subscription to function properly.
Avoid using this directive in conjunction with blocking operations, as it could degrade performance.