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.
Push and Pull server queue is designed for instant communication between many Bitrix24 tools and features, such as: Tasks, Calendar, Feed, Workgroups, RPA, the abovementioned Bitrix24 mobile application, Chats, Document Generator, Telephony, Sales Center and other services.
Push server is installed by default in the Virtual Appliance [ds]BitrixVM version 7.1 and later[/ds][di]Virtual Appliance saves time and effort needed for correct deployment and administration of site or internal data resource based on Bitrix24 products.
Learn more in the Bitrix Virtual Appliance course[/di].
We recommend to setup local queue Bitrix24 cloud server or local Bitrix Push server 2.0 in advance. You can find it in Push and Pull module and server configurations lesson.
You can find information on upgrading to the current server version (Bitrix Push server 2.0) in these lessons:
- Upgrade from Bitrix Push server 1.0 to Bitrix Push server 2.0;
- Upgrade from Nginx-PushStreamModule to Bitrix Push server 2.0 ;
- Using separate Bitrix Push server 2.0 on the Virtual Appliance;
- Configuring P&P module and queue server (cloud and local);
It is strongly recommended to upgrade to the latest BitrixVM versions.
For legacy Virtual Appliance versions, use the information hidden in the spoilers below.
Parameters for nginx-push-stream-module version 0.4.0 (recommended)
Parameters for nginx-push-stream-module version 0.3.4
Attention! In case of an error:
XMLHttpRequest cannot load http://example.com:8893/bitrix/sub/?CHANNEL_ID=<уникальный_адрес_канала>&tag=1&rnd=1380619831146. Origin http://example.com is not allowed by Access-Control-Allow-Origin.it means that you use nginx push stream module module version earlier than 0.3.4.
Either update module version, or comment the following strings:
add_header "Access-Control-Allow-Origin" "*"; add_header "Access-Control-Allow-Headers" "if-modified-since, origin, if-none-match";
More details on how to use the module can be found in the Bitrix Framework course inside the lesson on the [ds]Push and Pull module[/ds][di]Push & Pull operates in two modes:
continuous connection to special Queue server;
in server polling mode (60-20-10).
Lean more in Bitrix Framework learning course[/di].