Laravel websockets connection failed on production server #814
Replies: 3 comments 6 replies
-
I have a smilar issue, but what's weird is it's been working just fine for months. Until we upgraded to PHP 8 yesterday, it just stopped, and am now getting a similar error with an empty exception message, re-thrown from PusherBroadcaster.php.
This error is thrown from both my frontend, as well as the dashboard. My setup uses SSL, and the user (as defined in supervisor) has read access to the fullchain cert and private key. As part of debugging, I even tried running it in debug mode as root, but the error persists. Nothing in the logs. I've tinkered with SSL verification, on and off, but nothing makes a difference, even afterflushing config caches, restarting processes, etc. This could still well be an environment issue, but I just don't know what it could be, as everything is setup correctly, and it worked perfectly before the upgrade. Running Laravel 8.55, websockets 1.12 and pusher-http-php 5.0.3. My local ocnfiguration works fine, though it is of course in a Valet environment, and so it is configured slightly differently. |
Beta Was this translation helpful? Give feedback.
-
I was also facing the same issue. After contacting with hosting provider I found that my port 6001 was blocked in shared hosting. So that's why the laravel web socket is not working. Please check once if it's the same issue on your end also. |
Beta Was this translation helpful? Give feedback.
-
6001
…On Tue, 2 May, 2023, 9:45 pm Ivan Novikov, ***@***.***> wrote:
I was also facing the same issue. After contacting with hosting provider I
found that my port 6001 was blocked in shared hosting. So that's why the
laravel web socket is not working. Please check once if it's the same issue
on your end also.
What port are you running?
—
Reply to this email directly, view it on GitHub
<#814 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AV44C2PWYMWHWW6PQORRG7DXEEXKTANCNFSM5CSWNIHQ>
.
You are receiving this because you commented.Message ID:
<beyondcode/laravel-websockets/repo-discussions/814/comments/5782928@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
I've got a Laravel 8 API project along with a Nuxt JS front-end that uses Laravel Echo. I'm installed the Laravel Websockets server and have everything working just fine with the Pusher replacement config:
It's also worth noting here that I've also tried:
and...
However, when I deploy to my CentOS 8 server and start the websockets server with
php artisan websockets:serve
(I'm in debug mode) and I try to connect, I'm getting a connection failed error. I'm using the default port of6001
and default host of0.0.0.0
, the error I get from my front-end is:My front-end is for example: https://example-gui.example.com/ whilst my running API is on https://example-api.example.com/, both on the same server, and the same server as the running websockets server.
I'm using Cloudflare for HTTPs, and I'm not sure whether I need to change anything with the host?
I originally had the connection like this:
What am I missing to connect in production?
I'm stuck in knowing how to get it to connect!
Beta Was this translation helpful? Give feedback.
All reactions