Skip to content
Advertisement

Why Laravel Pusher is not working in server

I am using Pusher in my Web Application. My backend is built with Laravel & Frontend is built with Angular 10. Everything works perfectly in my local machine. But in the server it is not working. The client is failing to connect stating the following error:

JavaScript

In my local machine, everything is working properly. Both in the angular and the laravel project, I am using the same app key. And the keys are correctly collected from the pusher website.

Here is my Client Connecting Code:

JavaScript

And in my laravel env:

JavaScript

in my broadcasting.php

JavaScript

everything is working properly in the local machine. But in server this fails If you go to the following url, you will see, socket is getting connecting by laravel. http://api.etakweet.com/laravel-websockets

I have also noticed, no logs were found when event is getting broadcasted by laravel project.

Advertisement

Answer

Managed to connect by running the following command.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement