mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-01-22 10:38:14 -05:00
27 lines
647 B
PHP
27 lines
647 B
PHP
|
<?php
|
||
|
|
||
|
|
||
|
use Illuminate\Http\Request;
|
||
|
use SwooleTW\Http\Websocket\Facades\Websocket;
|
||
|
|
||
|
/*
|
||
|
|--------------------------------------------------------------------------
|
||
|
| Websocket Routes
|
||
|
|--------------------------------------------------------------------------
|
||
|
|
|
||
|
| Here is where you can register websocket events for your application.
|
||
|
|
|
||
|
*/
|
||
|
|
||
|
Websocket::on('connect', function ($websocket, Request $request) {
|
||
|
// called while socket on connect
|
||
|
});
|
||
|
|
||
|
Websocket::on('disconnect', function ($websocket) {
|
||
|
// called while socket on disconnect
|
||
|
});
|
||
|
|
||
|
Websocket::on('example', function ($websocket, $data) {
|
||
|
$websocket->emit('message', $data);
|
||
|
});
|