mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-23 11:27:30 +08:00
Initial commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?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);
|
||||
});
|
||||
Reference in New Issue
Block a user