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

后端 未结 5 1382
离开以前
离开以前 2021-01-04 01:27

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://l

相关标签:
5条回答
  • 2021-01-04 01:27

    Look in config/app.php if you have uncommented

    App\Providers\BroadcastServiceProvider::class,

    0 讨论(0)
  • 2021-01-04 01:29

    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.

    0 讨论(0)
  • 2021-01-04 01:36

    Are you missing csrf_token() in your blade file?

    You can add in the meta tag

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

    Check out your BroadcastServiceProvider.php and you should include your channel routes in the boot method.

    0 讨论(0)
  • 2021-01-04 01:37

    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']);
    
    0 讨论(0)
  • 2021-01-04 01:51

    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
    });
    
    0 讨论(0)
提交回复
热议问题