Skip to content

Commit

Permalink
jsonrpc websocket format
Browse files Browse the repository at this point in the history
  • Loading branch information
xtrime-ru committed Jan 15, 2020
1 parent 6d568c0 commit 8402a56
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
25 changes: 15 additions & 10 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion src/Controllers/EventsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ private function subscribeForUpdates(\Amp\Websocket\Client $client, ?string $req
if ($requestedSession && $session !== $requestedSession) {
return;
}
$update = [$session => $update];
$update = [
'jsonrpc' => '2.0',
'result' => [
'session' => $session,
'update' => $update,
],
'id' => null,
];

$this->multicast(
json_encode(
Expand Down

0 comments on commit 8402a56

Please sign in to comment.