Skip to content

Commit

Permalink
Merge pull request #1061 from akotulu/master
Browse files Browse the repository at this point in the history
Fixed onWebsocketConnected isn't called with SSL connection
  • Loading branch information
walkor authored Oct 10, 2024
2 parents 43f9aad + a3bf4be commit 7d9d8b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Protocols/Websocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,13 @@ public static function dealHandshake(string $buffer, TcpConnection $connection):
}
$handshakeMessage .= "\r\n";
// Send handshake response.
$status = $connection->send($handshakeMessage, true);
$connection->send($handshakeMessage, true);
// Mark handshake complete.
$connection->context->websocketHandshake = true;

// Try to emit onWebSocketConnected callback.
$onWebsocketConnected = $connection->onWebSocketConnected ?? $connection->worker->onWebSocketConnected ?? false;
if ($status && $onWebsocketConnected) {
if ($onWebsocketConnected) {
try {
$onWebsocketConnected($connection, $request);
} catch (Throwable $e) {
Expand Down

0 comments on commit 7d9d8b7

Please sign in to comment.