PHP code example of minxinqing / rpcwsw

1. Go to this page and download the library: Download minxinqing/rpcwsw 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/ */

    

minxinqing / rpcwsw example snippets


composer 

    
    return [
        'server' => [
            'host' => '0.0.0.0',
            'port' => 9527,
            'pid_file' => storage_path('app/swoole_pid'),
            'log_file' => storage_path('logs/swoole_log'),
            'daemonize' => 1,
            'worker_num' => 10,
            'task_worker_num' => 10,
        ]
    ];
    

    php artisan rpcwsw:server start
    

    
    return [
        'instance' => [
            'serverA' => [
                'host' => '0.0.0.0',
                'port' => 9527,
            ]
        ],
    ];
    

    $v = \Rpcwsw\server('serverA')->api('news/list', [], 'get');