BSP's avatar
Level 1

"broadcasting/auth" returns empty response to laravel echo over 443 (SSL)

The authentication on the private channel is working fine on my localhost (port 80) - it's returning a json like {'auth' : 'longstringasdasdasd'} and notifications work fine.

On the live site however, where everything is https, the "broadcasting/auth" route returns an empty response. The response header says Content Length : 0

Not sure which way to go and what to look for. Any help is appreciated! Thank you!

0 likes
8 replies
bashy's avatar

That means it's returning false? Unauthorised.

Check you actually pass the checks in the channel for that broadcast.

1 like
BSP's avatar
Level 1

Hi bashy,

I tried your idea and changed the code in channels.php to automatically return true no matter what:

Broadcast::channel('users.{id}', function ($user, $user_id) {
    return true;
//    return (int) $user->uid === (int) $user_id;
});

And I still get the same zero character response.

bashy's avatar

Hmm strange. Must be something else then. Worth a try!

1 like
BSP's avatar
BSP
OP
Best Answer
Level 1

Solved. This had nothing to do with https. I accidentally replaced the .env file on the server with an older version of .env that didn't have the proper information :| Rookie mistake

2 likes
jandante's avatar

I also got an empty 200 response. In my .env on production I forgot to set the BROADCAST_DRIVER to pusher... Google and this post set me in the right direction :).

11 likes
nekooee's avatar

My exact problem was the same. I had been struggling with AI for 48 hours, and it kept giving me useless answers while I tried all sorts of things, but nothing worked. Now I realized I had forgotten to take the BROADCAST_DRIVER value from the log and set it to “reverb.” Such a simple and funny mistake ended up delaying the whole project. Thanks for the reminder and for solving the issue.

Please or to participate in this conversation.