Laravel Echo / Pusher / Vue-/ broadcasting / auth返回空HTML响应

时间:2020-09-23 16:35:28

标签: laravel vue.js laravel-7 pusher laravel-echo

我设法在本地计算机上运行了laravel / echo / pusher聊天应用程序。但是,一旦我上载到服务器,授权端点似乎失败了。我做了很多尝试,使一切变得更糟。

在我的本地计算机上,我有(app.js):

window.Echo = new Echo({
authEndpoint : 'https://localhost/**********/*******/public/broadcasting/auth',
broadcaster: 'pusher',
key: '*****************',
cluster: '**',
forceTLS: true,});

成功连接了推送程序和广播事件。聊天工作正常。

上传到服务器后,我将其更改为:

window.Echo = new Echo({
authEndpoint : '/broadcasting/auth',
broadcaster: 'pusher',
key: '**************',
cluster: 'eu',
forceTLS: true,});

我检查了哪个重定向到https://example.com/broadcasting/auth。现在,此网址最初返回了404。在某些时候,我尝试再次使用:https://localhost/***/.../broadcasting/auth,但由于跨源请求而失败。

在大量使用配置文件后,composer和npm以某种方式不再返回特定的响应。 这是请求:

GET /broadcasting/auth HTTP/1.1
Host: domain_name
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Cookie: XSRF-TOKEN=token_value activebabies_session=session_token
Upgrade-Insecure-Requests: 1
Cache-Control: max-age=0

这是响应:

HTTP/1.1 200 OK
Date: Wed, 23 Sep 2020 16:26:01 GMT
Server: Apache
Cache-Control: no-cache, private
Set-Cookie: XSRF-TOKEN=token_value; expires=Wed, 23-Sep-2020 18:26:01 GMT; Max-Age=7200; path=/; samesite=lax
Set-Cookie: activebabies_session=session_value; expires=Wed, 23-Sep-2020 18:26:01 GMT; Max-Age=7200; path=/; httponly; samesite=lax
Content-Length: 0
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8

控制台中没有错误。在某些时候,存在与推杆的连接,只是没有广播事件。当前甚至没有与推杆的连接。

关于为什么会发生这种情况的任何想法?我很乐意发布任何可能需要的其他信息(app.js,.env文件,broadcasting.php),但是配置必须正确,因为它在本地可以工作...

0 个答案:

没有答案