laravel / reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.
https://reverb.laravel.com
MIT License
1.07k stars 82 forks source link

Reverb not broadcasting the event on channel #210

Closed aftabkhaliq86 closed 3 months ago

aftabkhaliq86 commented 3 months ago

Reverb Version

@beta

Laravel Version

11

PHP Version

8.2

Description

i am using Apache Cpanel my connection to Reverb is successful and events are being subscribed channels but when am broadcasting message not a single error and message is not being broadcast on channel not either in debug. but when I use BROADCAST_DRIVER=reverb** I get this error image if I don't use BROADCAST_DRIVER AND only use BROADCAST_CONNECTION=REVERB . then event is not being broadcaster

Steps To Reproduce

BROADCAST_DRIVER=reverb BROADCAST_CONNECTION=reverb CACHE_DRIVER=file FILESYSTEM_DISK=public QUEUE_CONNECTION=database image channels are being subscribed but events are not broadcast to that channel not shown in debug either and the job is completed successfully without error.

but if I add

BROADCAST_DRIVER = reverb start getting this error image

my echo file is as follow

window.Pusher = Pusher;

window.Echo = new Echo({ broadcaster: 'reverb', key: import.meta.env.VITE_REVERB_APP_KEY, wsHost: import.meta.env.VITE_REVERB_HOST, wsPort: import.meta.env.VITE_REVERB_PORT ?? 80, wssPort: import.meta.env.VITE_REVERB_PORT ?? 443, forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https', enabledTransports: ['ws', 'wss'], });

reverb config is

    'reverb' => [
        'host' => env('REVERB_SERVER_HOST', '0.0.0.0'),
        'port' => env('REVERB_SERVER_PORT', 8080),
        'hostname' => env('REVERB_HOST'),
        'options' => [
            'tls' => [
                'local_cert' => env('REVERB_LOCAL_CERT',null),
                'local_pk' => env('REVERB_LOCAL_PK',null),
                        'passphrase' => null,
                        'verify_peer'=>false,
                        'verify_peer_name'=>false,
                ],
        ],
        'max_request_size' => env('REVERB_MAX_REQUEST_SIZE', 10_000),
        'scaling' => [
            'enabled' => env('REVERB_SCALING_ENABLED', false),
            'channel' => env('REVERB_SCALING_CHANNEL', 'reverb'),
            'server' => [
                'url' => env('REDIS_URL'),
                'host' => env('REDIS_HOST', '127.0.0.1'),
                'port' => env('REDIS_PORT', '6379'),
                'username' => env('REDIS_USERNAME'),
                'password' => env('REDIS_PASSWORD'),
                'database' => env('REDIS_DB', '0'),
            ],
        ],
        'pulse_ingest_interval' => env('REVERB_PULSE_INGEST_INTERVAL', 15),
        'telescope_ingest_interval' => env('REVERB_TELESCOPE_INGEST_INTERVAL', 15),
    ],

],

broadcasting file is 

'reverb' => [ 'driver' => 'reverb', 'key' => env('REVERB_APP_KEY'), 'secret' => env('REVERB_APP_SECRET'), 'app_id' => env('REVERB_APP_ID'), 'options' => [ 'host' => env('REVERB_HOST'), 'port' => env('REVERB_PORT', 443), 'scheme' => 'http', 'useTLS' => 'false', 'curl_options' => [ 'CURLOPT_SSL_VERIFYHOST' => 0, 'CURLOPT_SSL_VERIFYPEER' => 0, ], ], 'client_options' => [ // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html 'verify' => false, ], ],

joedixon commented 3 months ago

It looks like you are running a secure server so think you will need to broadcast over https.

driesvints commented 3 months ago

Closing this issue because it's inactive, already solved, old or not relevant anymore. Feel to open up a new issue if you're still experiencing this.