PHP code example of jsnlib / swoole
1. Go to this page and download the library: Download jsnlib/swoole 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/ */
jsnlib / swoole example snippets
$ws = new swoole_websocket_server("0.0.0.0", 8080);
$ws->on('message', function ($ws, $frame) {
\Jsnlib\Swoole::push_all([
'ws' => $ws,
'self' => $frame->fd,
'is_send_self' => false,
'data' => $frame->data
]);
});