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;
    }