Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

http://localhost:8000/broadcasting/auth 404 (Not Found)

I am trying to make my app app connect to pusher on a private channel.

But I am getting the following error:

pusher.js?b3eb:593 POST http://localhost:8000/broadcasting/auth 404 (Not Found)

What maybe the cause of the error and how to resolve it.

like image 577
YaSh Chaudhary Avatar asked Jan 17 '17 18:01

YaSh Chaudhary


4 Answers

Look in config/app.php if you have uncommented

App\Providers\BroadcastServiceProvider::class,

like image 127
Eugene van der Merwe Avatar answered Nov 17 '22 06:11

Eugene van der Merwe


There are two Service Providers with Same name but different namespace in config/app.php

Illuminate\Broadcasting\BroadcastServiceProvider::class,

App\Providers\BroadcastServiceProvider::class,

So uncomment both of them. It will work.

like image 44
Prathamesh Palav Avatar answered Nov 17 '22 06:11

Prathamesh Palav


Hope your base url is wrong try to hardcore your base url like below

window.Echo = new Echo({
   authEndpoint : 'http://*******/public/broadcasting/auth',
    broadcaster: 'pusher',
    key: '********',
    cluster: '***',
    encrypted: true
});
like image 18
Muthu17 Avatar answered Nov 17 '22 06:11

Muthu17


Complete These Steps

1) In config/app.php uncomment this line-

App\Providers\BroadcastServiceProvider::class,

2) If above not work and still you've got the error - then I'm sure you are not logged in. Just login to your account and check(because it's your private broadcast).

It'll solve your issue and since you can also pass additional auth parameters as your need in app\Providers\BroadcastServiceProvider.php

Broadcast::routes(['middleware' => 'auth:admin']);
like image 14
Maniruzzaman Akash Avatar answered Nov 17 '22 07:11

Maniruzzaman Akash