Http: // localhost: 8000 / broadcasting / auth 404 (not found)

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

But I get the following error:

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

What could be the cause of the error and how to solve it.

+11
source share
8 answers

Look in config / app.php if you have uncommented

App\Providers\BroadcastServiceProvider::class,

+26
source

There are two service providers with the same name, but a different namespace in config / app.php

 Illuminate\Broadcasting\BroadcastServiceProvider::class, App\Providers\BroadcastServiceProvider::class, 

So chop them both. He will work.

+14
source

Hope your base URL is incorrect. Try the hardcore of your base url as shown below.

 window.Echo = new Echo({ authEndpoint : 'http://*******/public/broadcasting/auth', broadcaster: 'pusher', key: '********', cluster: '***', encrypted: true }); 
+12
source

Complete these steps

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

 App\Providers\BroadcastServiceProvider::class, 

2) If the above does not work , and you still have an error - then I'm sure that you are not logged in . Just log in to your account and check (because this is your private broadcast).

This will solve your problem, and since you can also pass additional auth parameters as you need in app\Providers\BroadcastServiceProvider.php

 Broadcast::routes(['middleware' => 'auth:admin']); 
+6
source

Are you missing csrf_token () in your click file?

You can add a meta tag.

 <meta name="csrf-token" content="{{ csrf_token() }}"> 

Check BroadcastServiceProvider.php and you must specify your channel routes in the download method.

0
source

Create your authorized channels in routes-> channels.php

 Broadcast::channel('chatroom', function ($user) { return $user; }); 

See documentation: https://laravel.com/docs/5.4/broadcasting#authorizing-channels

thanks

0
source

I use Broadcasting Laravel notifications with JWT, React, Laravel Echo, but I have a problem in authEndpoint ... it shows that the URL was not found

0
source

In my own case, I added

 authEndpoint: "../broadcasting/auth", 

In your own case, perhaps you should add

 authEndpoint: "broadcasting/auth", 

It happened to me like that.

-1
source

Source: https://habr.com/ru/post/1262948/


All Articles