简体   繁体   中英

Wrong auth code using laravel and pusher when using a presence channel

I am creating a chat rooms functionality on my website. However, when the client sends an /broadcasting/auth request on the channel, the returned auth code is in incorrect format. Specifically, it adds a colon at the start. However, it only does that during production, not on local.

routes/channels.php

Broadcast::channel('Chat.{roomId}', function ($user, $roomId) {
  return ['id' => $user->id, 'name' => $user->name];
});
[/broadcasting/auth response][1]

i have actually same issue and finally solved by setting following envs

PUSHER_APP_ID=xxxxxxxx
PUSHER_APP_KEY=xxxxxxx
PUSHER_APP_SECRET=xxxx
PUSHER_APP_CLUSTER=ap3

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