Skip to main content
Skip table of contents

Websockets

Websockets

Working with sockets description.

The pusher protocol is used for working with sockets.

After authentication, all users must subscribe to two channels:

  1. user.{ID} – used when a push notification needs to be sent to all user sessions

  2. token.{ID} – used when a push notification needs to be sent to a specific session

These channels are private, and depending on the library being used, the private- prefix needs to be added.

The URL for channel authorization is api/v1/broadcasting/auth

cURL
BASH
curl -k --request POST \
	--url 'https://your-domain' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '[]'
PHP
PHP
$data = array (
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => '/',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain', false, $context);
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.