src/Core/WebSocket.php
public static function enabled() {
        global $CFG;
        $config = isset($CFG->websocket_url) && isset($CFG->websocket_secret);
        if ( ! $config ) return false;
        $pieces = parse_url($CFG->websocket_url);
        $port = U::get($pieces,'port');
        $host = U::get($pieces,'host');
        if ( ! $port ) return false;
        if ( ! $host ) return false;
        return true;
    }
public static function enabled() {
        global $CFG;
        $config = isset($CFG->websocket_url) && isset($CFG->websocket_secret);
        if ( ! $config ) return false;
        $pieces = parse_url($CFG->websocket_url);
        $port = U::get($pieces,'port');
        $host = U::get($pieces,'host');
        if ( ! $port ) return false;
        if ( ! $host ) return false;
        return true;
    }
public static function enabled ( ) { global $ CFG ; $ config = isset ( $ CFG -> websocket_url ) && isset ( $ CFG -> websocket_secret ) ; if ( ! $ config ) return false ; $ pieces = parse_url ( $ CFG -> websocket_url ) ; $ port = U :: get ( $ pieces , 'port' ) ; $ host = U :: get ( $ pieces , 'host' ) ; if ( ! $ port ) return false ; if ( ! $ host ) return false ; return true ; }
Determine if this server is configured for web sockets.

Set these values in your config.php:

$CFG->websocket_secret = 'opensource';
$CFG->websocket_url = 'ws://localhost:2021';

You can run a local notification service for your development
by doing the following:

cd tsugi/admin
php rachet.php

You need to keep the rachet.php running for websockets to work.

The web socket server does not have to be on the same server as
the Tsugi hosting server.  You can support more than one Tsugi
server with a single rachet server as long as all of the Tsugi
servers have the websocket_url and websocket_secret.

$CFG->websocket_url = 'wss://socket.tsugicloud.org:443';

If the Tsugi tool server is running https, then it needs a
socket server that runs wss.  The TsugiCloud server uses
CloudFlare to converts its ws server to a wss server.
Determine if this server is configured for web sockets .