Fixed errors in examples

This commit is contained in:
2024-02-21 21:40:29 +01:00
parent 98324121f1
commit ea9865c177
2 changed files with 3 additions and 3 deletions

View File

@ -30,9 +30,9 @@ $websocket = new NoccyLabs\React\WebSocket\WebSocketMiddleware();
// Connect event handler, receives a WebSocketInterface.
// Ratchet handles security for you, this library does not. You should
// check everything important in the connect handdler and reject anything
// check everything important in the connect handler and reject anything
// that does not smell right. Here we just echo everything.
$websocket->on('connect', function (NoccyLabs\React\WebSocket\WebSocketInterface $connection) {
$websocket->on('connection', function (NoccyLabs\React\WebSocket\WebSocketInterface $connection) {
$websocket->on('text', function ($text) use ($websocket) {
$websocket->write($text);
});