PHP code example of reactificate / websocket

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

    

reactificate / websocket example snippets



use React\EventLoop\Factory;
use React\Http\Server;
use Reactificate\Websocket\Middleware;
use Reactificate\Websocket\Prebuilt\Servers\ChatServer;

er($loop, ...$wsServers);
$server->listen($socket);

$loop->run();
bash
php server.php