PHP code example of werkraum / websocket-provider

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

    

werkraum / websocket-provider example snippets


class YourMessageComponent implements Ratchet\MessageComponentInterface
{
    // interface methods with your logic go here
}

$conn->feUser
$conn->beUser

location /socket.io {
    proxy_pass http://localhost:18080;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $host;
}