PHP code example of jiechengyang / swoole-reverb

1. Go to this page and download the library: Download jiechengyang/swoole-reverb library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jiechengyang / swoole-reverb example snippets


return [
    'host' => env('REVERB_HOST', env('REVERB_HOST', '0.0.0.0')),
    'port' => env('SWOOLE_REVERB_PORT', env('REVERB_PORT', 8084)),
    'scheme' => env('REVERB_SCHEME', env('REVERB_SCHEME', 'http')),
    'app_id' => env('SWOOLE_REVERB_APP_KEY', env('REVERB_APP_ID')),
    'app_key' => env('SWOOLE_REVERB_APP_KEY', env('REVERB_APP_KEY')),
    'app_secret' => env('SWOOLE_REVERB_APP_SECRET', env('REVERB_APP_SECRET')),
    'connect_clear_tick_time' => env('SWOOLE_CONNECT_CLEAR_TICK_TIME', env('REVERB_APP_PING_INTERVAL', 60)),
    'options' => [
        'worker_num' => 1, //swoole_cpu_num(),
        'daemonize' => false,
        'log_file' => storage_path('logs/swoole_reverb.log'),
        'pid_file' => storage_path('logs/swoole_reverb.pid'),
    ],
    'redis' => [
        // 是否启用Redis通道管理器
        'enabled' => env('SWOOLE_REVERB_REDIS_ENABLED', false),
        // Redis连接配置
        'connection' => env('SWOOLE_REVERB_REDIS_CONNECTION', 'default'),
    ],
];
bash
php artisan vendor:publish --provider="SwooleReverb\Providers\SwooleReverbServerProvider"