首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >laravel pusher插座为空

laravel pusher插座为空
EN

Stack Overflow用户
提问于 2020-03-18 20:27:02
回答 1查看 967关注 0票数 1

我正在尝试使用带有pusher的laravel广播,但是我的套接字显示为空。

我的env文件

代码语言:javascript
复制
  BROADCAST_DRIVER=pusher
  CACHE_DRIVER=file
  QUEUE_CONNECTION=sync
  SESSION_DRIVER=file
  SESSION_LIFETIME=120

  PUSHER_APP_ID=12345
  PUSHER_APP_KEY=ABCDEFG
  PUSHER_APP_SECRET=HKLMNOP
  PUSHER_APP_CLUSTER=mt1
  PUSHER_APP_HOST=127.0.0.1
  MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
  MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
EN

回答 1

Stack Overflow用户

发布于 2020-03-18 21:42:51

在你的broadcasting.php中,你是否设置了'options‘,’=>‘,’=>‘,'encrypted’=>是真的,你的broadcasting.php应该如下所示

代码语言:javascript
复制
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Default Broadcaster
    |--------------------------------------------------------------------------
    |
    | This option controls the default broadcaster that will be used by the
    | framework when an event needs to be broadcast. You may set this to
    | any of the connections defined in the "connections" array below.
    |
    | Supported: "pusher", "redis", "log", "null"
    |
    */

    'default' => env('BROADCAST_DRIVER', 'null'),

    /*
    |--------------------------------------------------------------------------
    | Broadcast Connections
    |--------------------------------------------------------------------------
    |
    | Here you may define all of the broadcast connections that will be used
    | to broadcast events to other systems or over websockets. Samples of
    | each available type of connection are provided inside this array.
    |
    */

    'connections' => [

        'pusher' => [
            'driver' => 'pusher',
            'key' => env('PUSHER_APP_KEY'),
            'secret' => env('PUSHER_APP_SECRET'),
            'app_id' => env('PUSHER_APP_ID'),
            'options' => [
                'cluster' => 'ap2',
                'encrypted' => true
            ],
        ],

        'redis' => [
            'driver' => 'redis',
            'connection' => 'default',
        ],

        'log' => [
            'driver' => 'log',
        ],

        'null' => [
            'driver' => 'null',
        ],

    ],

];
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60739573

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档