Skip to content

Commit

Permalink
Merge pull request #46 from sirn-se/redirect-follow
Browse files Browse the repository at this point in the history
Documentation
  • Loading branch information
sirn-se authored Mar 23, 2024
2 parents 705c3b9 + 5c7296d commit 5e0321b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ The `PingInterval` (possibly change interval) will keep conneciton open.
If something goes wrong, it will in most cases be able to re-connect and resume subscription.

```php
use Psr\Http\Message\ResponseInterface;
use WebSocket\Client;
use WebSocket\Connection;
use WebSocket\Connection;
Expand All @@ -60,7 +61,7 @@ $client
->addMiddleware(new PingResponder())
// Add ping interval middleware as heartbeat to keep connection open
->addMiddleware(new PingInterval(interval: 30))
->onConnect(function (Client $client, Connection $connection, Message $message) {
->onConnect(function (Client $client, Connection $connection, ResponseInterface $response) {
// Initial message, typically some authorization or configuration
// This will be called everytime the client connect or reconnect
$client->text($initial_message);
Expand Down

0 comments on commit 5e0321b

Please sign in to comment.