Laravel 5.4 pusher error

2019-08-06 04:25发布

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."}}}

2条回答
倾城 Initia
2楼-- · 2019-08-06 04:35
'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

查看更多
闹够了就滚
3楼-- · 2019-08-06 04:50

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

查看更多
登录 后发表回答