简体   繁体   中英

how authenticate private channel with echo server in laravel

I am trying to implement WebSocket using laravel echo server, and I have a private channel , but I am not able to have authenticated users this is my broadcast service provider

 public function boot()
    {
 
        Broadcast::routes([
            "middleware" => ['api','auth:api'],
 
        ]);
        require base_path('routes/channels.php');
    }

i set localhost and ip and APP_URL and host to 0.0.0.0 thhen i send CSRF token some time may thay have diffrent destination that why i set them in one (0.0.0.0) and it works ! and csrf like this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM