1
0
Fork 0
mirror of synced 2024-06-29 19:50:26 +12:00

Added docs

This commit is contained in:
Eldad Fux 2020-10-17 08:48:03 +03:00
parent 875c83a137
commit 3cb584430b

View file

@ -12,6 +12,10 @@ use Swoole\WebSocket\Frame;
* - Limit payload size
* - Message structure: { status: "ok"|"error", event: EVENT_NAME, data: <any arbitrary data> }
* - JWT Authentication (in path / or in message)
*
*
* - https://github.com/hhxsv5/php-sse
* - https://github.com/shuixn/socket.io-swoole-server
*/
$server = new Server("0.0.0.0", 80);
@ -25,6 +29,8 @@ $server->on('open', function(Server $server, Swoole\Http\Request $request) {
// $server->tick(1000, function() use ($server, $request) {
// $server->push($request->fd, json_encode(["hello", time()]));
// });
var_dump($request->header);
$server->push($request->fd, json_encode(["hello", time()]));
});