Skip to content

Add Connection::params() to access parameters passed in handshake request#8

Merged
thekid merged 3 commits intomasterfrom
feature/connection-params
Apr 1, 2026
Merged

Add Connection::params() to access parameters passed in handshake request#8
thekid merged 3 commits intomasterfrom
feature/connection-params

Conversation

@thekid
Copy link
Copy Markdown
Member

@thekid thekid commented Apr 1, 2026

 class Chat extends Listener {

   public function open($connection) {
  
-    // FIXME: Connection should have path and params separately
-    $path= $connection->path();
-    parse_str(substr($path, strpos($path, '?') + 1), $params);
  
-    if ($for= $params['for'] ?? null) {
+    if ($for= $connection->param('for')) {
       $this->clients->subscribe($connection->id(), $for);
     }
   }

   // ...
 }

@thekid thekid added the enhancement New feature or request label Apr 1, 2026
@thekid thekid merged commit 5700139 into master Apr 1, 2026
16 checks passed
@thekid thekid deleted the feature/connection-params branch April 1, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant