Skip to content

Commit b900d32

Browse files
committed
update websocket client code
1 parent b78ca84 commit b900d32

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

solid/lib/Notifications/SolidPubSub.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,10 @@ public function __construct($pubsubUrl) {
1414
public function send($path, $type) {
1515
$pubsub = str_replace(["https://", "http://"], "wss://", $this->pubsub);
1616

17-
$client = new Client($pubsub, array(
18-
'headers' => array(
19-
'Sec-WebSocket-Protocol' => 'solid-0.1'
20-
)
21-
));
22-
17+
$client = new Client($pubsub);
18+
$client->addHeader("Sec-WebSocket-Protocol", "solid-0.1");
2319
try {
24-
$client->send("pub $path\n");
20+
$client->text("pub $path\n");
2521
} catch (\WebSocket\Exception $exception) {
2622
throw new \Exception('Could not write to pubsub server', 502, $exception);
2723
}

0 commit comments

Comments
 (0)