1

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

2
  • Try ping to host url app.myapp.com, or if you have added http:// or https:// protocols before. Commented Aug 18, 2023 at 8:44
  • Thanks for your comment it was an server side issue, I was running jitsi-meet and the soketi and the laravel in a same droplet. after move the jitsi-meet to another droplet, it was fixed. Commented Aug 19, 2023 at 9:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.