Skip to content

Commit

Permalink
Update WebSocketServeCommand.php
Browse files Browse the repository at this point in the history
  • Loading branch information
kawax committed Nov 18, 2024
1 parent ca95ef1 commit 89f0543
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Console/WebSocketServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
* php artisan bluesky:ws -v
* ```
*
* This is an advanced usage so they probably won't document it.
*
* @see https://github.com/bluesky-social/jetstream
*/
class WebSocketServeCommand extends Command
Expand Down Expand Up @@ -70,12 +72,13 @@ public function handle(): int
{
$handlerStack = new HandlerStack(new StreamHandler());
$handlerStack->push(new WebSocketMiddleware());

$client = new Client(['handler' => $handlerStack]);

$host = $this->option('host');

$res = $client->get('wss://'.$host.'/subscribe?requireHello=true');
$uri = 'wss://'.$host.'/subscribe?requireHello=true';

$res = $client->get($uri);

if ($res->getStatusCode() !== 101) {
dd($res);
Expand Down

0 comments on commit 89f0543

Please sign in to comment.