websockets.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?php
  2. use BeyondCode\LaravelWebSockets\Dashboard\Http\Middleware\Authorize;
  3. return [
  4. /*
  5. * Set a custom dashboard configuration
  6. */
  7. 'dashboard' => [
  8. 'port' => env('LARAVEL_WEBSOCKETS_PORT', 6001),
  9. ],
  10. /*
  11. * This package comes with multi tenancy out of the box. Here you can
  12. * configure the different apps that can use the webSockets server.
  13. *
  14. * Optionally you specify capacity so you can limit the maximum
  15. * concurrent connections for a specific app.
  16. *
  17. * Optionally you can disable client events so clients cannot send
  18. * messages to each other via the webSockets.
  19. */
  20. 'apps' => [
  21. [
  22. 'id' => env('PUSHER_APP_ID'),
  23. 'name' => env('APP_NAME'),
  24. 'key' => env('PUSHER_APP_KEY'),
  25. 'secret' => env('PUSHER_APP_SECRET'),
  26. 'path' => env('PUSHER_APP_PATH'),
  27. 'capacity' => null,
  28. 'enable_client_messages' => false,
  29. 'enable_statistics' => true,
  30. ],
  31. ],
  32. /*
  33. * This class is responsible for finding the apps. The default provider
  34. * will use the apps defined in this config file.
  35. *
  36. * You can create a custom provider by implementing the
  37. * `AppProvider` interface.
  38. */
  39. 'app_provider' => BeyondCode\LaravelWebSockets\Apps\ConfigAppProvider::class,
  40. /*
  41. * This array contains the hosts of which you want to allow incoming requests.
  42. * Leave this empty if you want to accept requests from all hosts.
  43. */
  44. 'allowed_origins' => [
  45. //
  46. ],
  47. /*
  48. * The maximum request size in kilobytes that is allowed for an incoming WebSocket request.
  49. */
  50. 'max_request_size_in_kb' => 250,
  51. /*
  52. * This path will be used to register the necessary routes for the package.
  53. */
  54. 'path' => 'laravel-websockets',
  55. /*
  56. * Dashboard Routes Middleware
  57. *
  58. * These middleware will be assigned to every dashboard route, giving you
  59. * the chance to add your own middleware to this list or change any of
  60. * the existing middleware. Or, you can simply stick with this list.
  61. */
  62. 'middleware' => [
  63. 'web',
  64. Authorize::class,
  65. ],
  66. 'statistics' => [
  67. /*
  68. * This model will be used to store the statistics of the WebSocketsServer.
  69. * The only requirement is that the model should extend
  70. * `WebSocketsStatisticsEntry` provided by this package.
  71. */
  72. 'model' => \BeyondCode\LaravelWebSockets\Statistics\Models\WebSocketsStatisticsEntry::class,
  73. /*
  74. * Here you can specify the interval in seconds at which statistics should be logged.
  75. */
  76. 'interval_in_seconds' => 60,
  77. /*
  78. * When the clean-command is executed, all recorded statistics older than
  79. * the number of days specified here will be deleted.
  80. */
  81. 'delete_statistics_older_than_days' => 60,
  82. /*
  83. * Use an DNS resolver to make the requests to the statistics logger
  84. * default is to resolve everything to 127.0.0.1.
  85. */
  86. 'perform_dns_lookup' => false,
  87. ],
  88. /*
  89. * Define the optional SSL context for your WebSocket connections.
  90. * You can see all available options at: http://php.net/manual/en/context.ssl.php
  91. */
  92. 'ssl' => [
  93. /*
  94. * Path to local certificate file on filesystem. It must be a PEM encoded file which
  95. * contains your certificate and private key. It can optionally contain the
  96. * certificate chain of issuers. The private key also may be contained
  97. * in a separate file specified by local_pk.
  98. */
  99. 'local_cert' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT', null),
  100. /*
  101. * Path to local private key file on filesystem in case of separate files for
  102. * certificate (local_cert) and private key.
  103. */
  104. 'local_pk' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_PK', null),
  105. /*
  106. * Passphrase for your local_cert file.
  107. */
  108. 'passphrase' => env('LARAVEL_WEBSOCKETS_SSL_PASSPHRASE', null),
  109. ],
  110. /*
  111. * Channel Manager
  112. * This class handles how channel persistence is handled.
  113. * By default, persistence is stored in an array by the running webserver.
  114. * The only requirement is that the class should implement
  115. * `ChannelManager` interface provided by this package.
  116. */
  117. 'channel_manager' => \BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManagers\ArrayChannelManager::class,
  118. ];