broadcasting.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Default Broadcaster
  6. |--------------------------------------------------------------------------
  7. |
  8. | This option controls the default broadcaster that will be used by the
  9. | framework when an event needs to be broadcast. You may set this to
  10. | any of the connections defined in the "connections" array below.
  11. |
  12. | Supported: "reverb", "pusher", "ably", "redis", "log", "null"
  13. |
  14. */
  15. 'default' => env('BROADCAST_CONNECTION', env('BROADCAST_DRIVER', 'null')),
  16. /*
  17. |--------------------------------------------------------------------------
  18. | Broadcast Connections
  19. |--------------------------------------------------------------------------
  20. |
  21. | Here you may define all of the broadcast connections that will be used
  22. | to broadcast events to other systems or over websockets. Samples of
  23. | each available type of connection are provided inside this array.
  24. |
  25. */
  26. 'connections' => [
  27. // 后台实时推送(config/admin_realtime.php)固定走此连接,Laravel 经内网 HTTP 调用 Reverb
  28. 'reverb' => [
  29. 'driver' => 'reverb',
  30. 'key' => env('REVERB_APP_KEY'),
  31. 'secret' => env('REVERB_APP_SECRET'),
  32. 'app_id' => env('REVERB_APP_ID'),
  33. 'options' => [
  34. 'host' => env('REVERB_HOST'),
  35. 'port' => env('REVERB_PORT', 443),
  36. 'scheme' => env('REVERB_SCHEME', 'https'),
  37. 'useTLS' => env('REVERB_SCHEME', 'https') === 'https',
  38. ],
  39. 'client_options' => [
  40. 'connect_timeout' => 3,
  41. 'timeout' => 5,
  42. ],
  43. ],
  44. 'pusher' => [
  45. 'driver' => 'pusher',
  46. 'key' => env('PUSHER_APP_KEY'),
  47. 'secret' => env('PUSHER_APP_SECRET'),
  48. 'app_id' => env('PUSHER_APP_ID'),
  49. 'options' => [
  50. 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
  51. 'port' => env('PUSHER_PORT', 443),
  52. 'scheme' => env('PUSHER_SCHEME', 'https'),
  53. 'encrypted' => true,
  54. 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
  55. ],
  56. 'client_options' => [
  57. // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
  58. ],
  59. ],
  60. 'ably' => [
  61. 'driver' => 'ably',
  62. 'key' => env('ABLY_KEY'),
  63. ],
  64. 'redis' => [
  65. 'driver' => 'redis',
  66. 'connection' => 'default',
  67. ],
  68. 'log' => [
  69. 'driver' => 'log',
  70. ],
  71. 'null' => [
  72. 'driver' => 'null',
  73. ],
  74. ],
  75. ];