![](/img/trans.png)
[英]Laravel Websockets Failed to connect to Pusher (on production only)
[英]Laravel WebSockets pusher in AWS
我创建了一个套接字应用程序,它在本地运行良好,但是当我想测试它是否可以在 AWS 中运行时,它给了我这个错误
Illuminate\Broadcasting\BroadcastException Pusher 错误:{“错误”:“提供了未知的应用程序 ID 12345
”}。
我不知道 AWS 上的设置会有所不同还是缓存问题
这是我的座位
广播.php
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
//'useTLS' => true,
//'forceTLS'=>true,
'encrypted' => true,
'host' => '127.0.0.1',
'port'=>'6001',
'scheme'=> 'http',
//'curl_options' => [
// CURLOPT_SSL_VERIFYHOST => 0,
// CURLOPT_SSL_VERIFYPEER => 0,
// ]
],
],
websoket.php
'apps' => [
[
'id' => env('PUSHER_APP_ID'),
'name' => env('APP_NAME'),
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
//'path' => env('PUSHER_APP_PATH'),
//'capacity' => null,
'enable_client_messages' => false,
'enable_statistics' => true,
],
],
bootstrap.php
window.Echo = new Echo({
broadcaster: 'pusher',
key: env('PUSHER_APP_KEY'),
//cluster: process.env.MIX_PUSHER_APP_CLUSTER,
//forceTLS: true,
wsHost: window.location.hostname,
wsPort: 6001,
forceTLS: false,
disableStats: true, });
这意味着您可能需要更改broadcasting.php
中的'host'
。php 以指向您的 laravel-websockets 正在运行的任何 IP/域
我用了我的名字,它起作用了
PUSHER_APP_ID=fredrickshayo
PUSHER_APP_KEY=fredrickshayo
PUSHER_APP_SECRET=fredrickshayo
PUSHER_APP_CLUSTER=mt1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.