laravelpusherlaravel-reverb

Laravel 11 Reverb : BroadcastException: Pusher Error (Not found)


In my local pc its working fine. But in production (Apache server) its giving the BroadcastException Pusher Error (Not found) when triggering any event

REVERB_APP_ID=401372 
REVERB_APP_KEY=vcgwou45dwfj3qek4ixsv 
REVERB_APP_SECRET=o1jvqub6yshtowosmgbz 
REVERB_HOST="sub.doamin.com" 
REVERB_PORT=443 
REVERB_SCHEME=https

#REVERB_SERVER_HOST="0.0.0.0" 
#REVERB_SERVER_PORT=8080

VITE_REVERB_APP_KEY="${REVERB_APP_KEY}" 
VITE_REVERB_HOST="${REVERB_HOST}" 
VITE_REVERB_PORT="${REVERB_PORT}" 
VITE_REVERB_SCHEME="${REVERB_SCHEME}"

php artisan rverb:start --debug

Starting server on 0.0.0.0:8080 (sub.domain.com) 
Connection Established.....

But when triggering the event it gives BroadcastException;

broadcast(new FriendRequestReceived($sender, $receiver));

public function broadcastOn(): array { 
   return [ new PrivateChannel("friend-request.{$this->receiver->id}"), ]; 
}

on my vhost 443 config

ProxyPass /app  ws://0.0.0.0:8080/app
ProxyPassReverse /app ws://0.0.0.0:8080/app

Solution

  • vhost:

    ProxyPreserveHost On
    <Location /app>
            ProxyPass ws://0.0.0.0:8080/app
            ProxyPassReverse ws://0.0.0.0:8080/app
    </Location>
    <Location /apps>
            ProxyPass http://0.0.0.0:8080/apps
            ProxyPassReverse http://0.0.0.0:8080/apps
    </Location>
    

    It's worked