We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1be49ff commit 9657af6Copy full SHA for 9657af6
lib/Handshake.php
@@ -67,9 +67,9 @@ public function generateRequest(): string {
67
}
68
69
70
- if ($this->accept === null) {
71
- $this->accept = \base64_encode(\random_bytes(self::ACCEPT_NONCE_LENGTH));
72
- }
+ // This has to be generated for each connect attempt, once a new request has been generated,
+ // we use the new key for validation.
+ $this->accept = \base64_encode(\random_bytes(self::ACCEPT_NONCE_LENGTH));
73
74
return 'GET ' . $this->path . " HTTP/1.1\r\nConnection: Upgrade\r\nUpgrade: websocket\r\nSec-Websocket-Version: 13\r\nSec-Websocket-Key: {$this->accept}\r\n$headers\r\n";
75
0 commit comments