Bitrix24 Push and Pull module operation on the Bitrix Virtual Appliance version up to 5.0.
At the server side, broadcasting instant messages is backed up by the nginx module: nginx-push-stream-module. This module supports long-polling client connections and ensures message delivery.
Note: Bitrix Framework is capable of providing considerably high messaging rate without nginx-push-stream-module: max. interval of 60 seconds, which reduces to 10 seconds if there are pending messages.
When a client opens a page, the former sends an AJAX request to connect to a listening channel on one of the nginx ports: 8893 (http) or 8894 (https). Then, nginx redirects the client to an internal queue server (available only at 127.0.0.1:8895). The server checks the channel for new messages and, if there are none, holds the connection for 40 seconds but does not respond.
If a new message becomes available in the client listening channel within 40 seconds, the server sends it to the client and closes the connection. Otherwise, the server just sends the "304 Not Modified" response to the client and closes the connection.
Once the client has received the server response and the connection is closed, the client can connect again sending the last-modified date and time.
User applications can send messages to the client listening channel by using the Push and Pull module API calls.
It is generally recommended to use HTTPS for push and pull communication.
Note: The time at the server must be consistent. Perform time synchronization regularly to ensure correct channel status.
Configuring the Module
If you use Bitrix Framework distributions with BitrixVM or BitrixEnvironment (for Linux) version 5.0 or better, you won't have to configure anything. If you employ some kind of custom installation, the module configuration will require the following steps.
Note: The example provided below is given only as a sample. The configuration of a web project not based on either the BitrixVM or BitrixEnvironment is the sole responsibility of the project’s administrator.
Last Modified: 13.09.2021