Laravel 5.4 pusher error

℡╲_俬逩灬. 提交于 2019-12-08 01:14:22

问题


I am using pusher in Laravel 5.4 but I'm getting following error:

WebSocket connection to 'ws://ws.pusherapp.com/app/731e32c5f123456298e?protocol=7&client=js&version=4.1.0&flash=false' failed: WebSocket is closed before the connection is established.

Pusher : Error : {"type":"WebSocketError","error":{"type":"PusherError","data":{"code":4001,"message":"Did you forget to specify the cluster when creating the Pusher instance? App key 731e32c5f123456298e does not exist in this cluster."}}}


回答1:


It looks like you've copied your pusher app_key incorrectly. Pusher app keys typically have 20 characters, yours has 19.




回答2:


'pusher' => [
        'driver'      => 'pusher',
        'key'           => env('PUSHER_KEY'),
        'secret'     => env('PUSHER_SECRET'),
        'app_id'     => env('PUSHER_APP_ID'),
        'options'   => [
            'cluster'        =>   <your cluster>  ,
            'encrypted' => true,
        ],
    ],

Specify your cluster

however if you are testing on localhost encrypted should be false



来源:https://stackoverflow.com/questions/44960405/laravel-5-4-pusher-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!