| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <?php
- return [
- /*
- |--------------------------------------------------------------------------
- | Websocket handler for onOpen and onClose callback
- | Replace this handler if you want to customize your websocket handler
- |--------------------------------------------------------------------------
- */
- 'handler' => SwooleTW\Http\Websocket\SocketIO\WebsocketHandler::class,
- /*
- |--------------------------------------------------------------------------
- | Default frame parser
- | Replace it if you want to customize your websocket payload
- |--------------------------------------------------------------------------
- */
- 'parser' => SwooleTW\Http\Websocket\SocketIO\SocketIOParser::class,
- /*
- |--------------------------------------------------------------------------
- | Websocket route file path
- |--------------------------------------------------------------------------
- */
- 'route_file' => base_path('routes/websocket.php'),
- /*
- |--------------------------------------------------------------------------
- | Default middleware for on connect request
- |--------------------------------------------------------------------------
- */
- 'middleware' => [
- // SwooleTW\Http\Websocket\Middleware\DecryptCookies::class,
- // SwooleTW\Http\Websocket\Middleware\StartSession::class,
- // SwooleTW\Http\Websocket\Middleware\Authenticate::class,
- ],
- /*
- |--------------------------------------------------------------------------
- | Websocket handler for customized onHandShake callback
- |--------------------------------------------------------------------------
- */
- 'handshake' => [
- 'enabled' => false,
- 'handler' => SwooleTW\Http\Websocket\HandShakeHandler::class,
- ],
- /*
- |--------------------------------------------------------------------------
- | Default websocket driver
- |--------------------------------------------------------------------------
- */
- 'default' => 'table',
- /*
- |--------------------------------------------------------------------------
- | Websocket client's heartbeat interval (ms)
- |--------------------------------------------------------------------------
- */
- 'ping_interval' => 25000,
- /*
- |--------------------------------------------------------------------------
- | Websocket client's heartbeat interval timeout (ms)
- |--------------------------------------------------------------------------
- */
- 'ping_timeout' => 60000,
- /*
- |--------------------------------------------------------------------------
- | Room drivers mapping
- |--------------------------------------------------------------------------
- */
- 'drivers' => [
- 'table' => SwooleTW\Http\Websocket\Rooms\TableRoom::class,
- 'redis' => SwooleTW\Http\Websocket\Rooms\RedisRoom::class,
- ],
- /*
- |--------------------------------------------------------------------------
- | Room drivers settings
- |--------------------------------------------------------------------------
- */
- 'settings' => [
- 'table' => [
- 'room_rows' => 4096,
- 'room_size' => 2048,
- 'client_rows' => 8192,
- 'client_size' => 2048,
- ],
- 'redis' => [
- 'server' => [
- 'host' => env('REDIS_HOST', '127.0.0.1'),
- 'password' => env('REDIS_PASSWORD', null),
- 'port' => env('REDIS_PORT', 6379),
- 'database' => 0,
- 'persistent' => true,
- ],
- 'options' => [
- //
- ],
- 'prefix' => 'swoole:',
- ],
- ],
- ];
|