I have been working with a project where I need the socket connection for realtime connection. I am using soketi for the socket provider with Laravel.
My socket connection is working fine, but in my laravel application when I sent a message and it's trigger a broadcast event by broadcast(new MessageSent($message)) then it's failing.
here is the error from Horizon.
Illuminate\Broadcasting\BroadcastException: Pusher error: cURL error 6: Could not resolve host: app.myapp.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://app.myapp.com:6001/apps/my-ws/events?auth_key=my-websocket&auth_timestamp=1692289479&auth_version=1.0&body_md5=561d4438f98606b843b8ac36060e4a3a&auth_signature=22adda43c4c31c85a56de51fa0107ca6be7c0a17ee5b0ae4790fa862821c6856. in /var/www/laravel-app/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php:164
Composer.json
"php": "^8.0",
"barryvdh/laravel-dompdf": "^2.0",
"carlos-meneses/laravel-mpdf": "^2.1",
"guzzlehttp/guzzle": "^7.0",
"laravel/framework": "^10.0",
"laravel/horizon": "^5.19",
"laravel/socialite": "^5.4",
"laravel/tinker": "^2.0",
"laravel/ui": "^4.2",
"predis/predis": "^2.0",
"pusher/pusher-php-server": "^7.2"
"twilio/sdk": "^7.0",
"tymon/jwt-auth": "^2.0"
Server info
- Digital Ocean / Ubuntu 22.04
- PHP8.1
- Nginx
Soketi is installed in this machine by there doc and run by pm2 - process manager.
Laravel should success to broadcast the event