|
1 | 1 | <?php
|
2 | 2 |
|
3 |
| -use BeyondCode\LaravelWebSockets\Dashboard\Http\Middleware\Authorize; |
4 |
| - |
5 | 3 | return [
|
6 | 4 |
|
7 | 5 | /*
|
8 |
| - * Set a custom dashboard configuration |
9 |
| - */ |
| 6 | + |-------------------------------------------------------------------------- |
| 7 | + | Dashboard Settings |
| 8 | + |-------------------------------------------------------------------------- |
| 9 | + | |
| 10 | + | You can configure the dashboard settings from here. |
| 11 | + | |
| 12 | + */ |
| 13 | + |
10 | 14 | 'dashboard' => [
|
| 15 | + |
11 | 16 | 'port' => env('LARAVEL_WEBSOCKETS_PORT', 6001),
|
| 17 | + |
| 18 | + 'path' => 'laravel-websockets', |
| 19 | + |
| 20 | + 'middleware' => [ |
| 21 | + 'web', |
| 22 | + \BeyondCode\LaravelWebSockets\Dashboard\Http\Middleware\Authorize::class, |
| 23 | + ], |
| 24 | + |
| 25 | + ], |
| 26 | + |
| 27 | + 'managers' => [ |
| 28 | + |
| 29 | + /* |
| 30 | + |-------------------------------------------------------------------------- |
| 31 | + | Application Manager |
| 32 | + |-------------------------------------------------------------------------- |
| 33 | + | |
| 34 | + | An Application manager determines how your websocket server allows |
| 35 | + | the use of the TCP protocol based on, for example, a list of allowed |
| 36 | + | applications. |
| 37 | + | By default, it uses the defined array in the config file, but you can |
| 38 | + | anytime implement the same interface as the class and add your own |
| 39 | + | custom method to retrieve the apps. |
| 40 | + | |
| 41 | + */ |
| 42 | + |
| 43 | + 'app' => \BeyondCode\LaravelWebSockets\Apps\ConfigAppProvider::class, |
| 44 | + |
| 45 | + /* |
| 46 | + |-------------------------------------------------------------------------- |
| 47 | + | Channel Manager |
| 48 | + |-------------------------------------------------------------------------- |
| 49 | + | |
| 50 | + | When users subscribe or unsubscribe from specific channels, |
| 51 | + | the connections are stored to keep track of any interaction with the |
| 52 | + | WebSocket server. |
| 53 | + | You can however add your own implementation that will help the store |
| 54 | + | of the channels alongside their connections. |
| 55 | + | |
| 56 | + */ |
| 57 | + |
| 58 | + 'channel' => \BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManagers\ArrayChannelManager::class, |
12 | 59 | ],
|
13 | 60 |
|
14 | 61 | /*
|
|
34 | 81 | ],
|
35 | 82 | ],
|
36 | 83 |
|
37 |
| - /* |
38 |
| - * This class is responsible for finding the apps. The default provider |
39 |
| - * will use the apps defined in this config file. |
40 |
| - * |
41 |
| - * You can create a custom provider by implementing the |
42 |
| - * `AppProvider` interface. |
43 |
| - */ |
44 |
| - 'app_provider' => BeyondCode\LaravelWebSockets\Apps\ConfigAppProvider::class, |
45 |
| - |
46 | 84 | /*
|
47 | 85 | * This array contains the hosts of which you want to allow incoming requests.
|
48 | 86 | * Leave this empty if you want to accept requests from all hosts.
|
|
57 | 95 | 'max_request_size_in_kb' => 250,
|
58 | 96 |
|
59 | 97 | /*
|
60 |
| - * This path will be used to register the necessary routes for the package. |
| 98 | + * Define the optional SSL context for your WebSocket connections. |
| 99 | + * You can see all available options at: http://php.net/manual/en/context.ssl.php |
61 | 100 | */
|
62 |
| - 'path' => 'laravel-websockets', |
| 101 | + 'ssl' => [ |
| 102 | + /* |
| 103 | + * Path to local certificate file on filesystem. It must be a PEM encoded file which |
| 104 | + * contains your certificate and private key. It can optionally contain the |
| 105 | + * certificate chain of issuers. The private key also may be contained |
| 106 | + * in a separate file specified by local_pk. |
| 107 | + */ |
| 108 | + 'local_cert' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT', null), |
63 | 109 |
|
64 |
| - /* |
65 |
| - * Dashboard Routes Middleware |
66 |
| - * |
67 |
| - * These middleware will be assigned to every dashboard route, giving you |
68 |
| - * the chance to add your own middleware to this list or change any of |
69 |
| - * the existing middleware. Or, you can simply stick with this list. |
70 |
| - */ |
71 |
| - 'middleware' => [ |
72 |
| - 'web', |
73 |
| - Authorize::class, |
| 110 | + /* |
| 111 | + * Path to local private key file on filesystem in case of separate files for |
| 112 | + * certificate (local_cert) and private key. |
| 113 | + */ |
| 114 | + 'local_pk' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_PK', null), |
| 115 | + |
| 116 | + /* |
| 117 | + * Passphrase for your local_cert file. |
| 118 | + */ |
| 119 | + 'passphrase' => env('LARAVEL_WEBSOCKETS_SSL_PASSPHRASE', null), |
74 | 120 | ],
|
75 | 121 |
|
76 | 122 | 'statistics' => [
|
| 123 | + |
77 | 124 | /*
|
78 | 125 | * This model will be used to store the statistics of the WebSocketsServer.
|
79 | 126 | * The only requirement is that the model should extend
|
|
85 | 132 | * The Statistics Logger will, by default, handle the incoming statistics, store them
|
86 | 133 | * and then release them into the database on each interval defined below.
|
87 | 134 | */
|
| 135 | + |
88 | 136 | 'logger' => \BeyondCode\LaravelWebSockets\Statistics\Logger::class,
|
89 | 137 |
|
90 | 138 | /*
|
91 | 139 | * Here you can specify the interval in seconds at which statistics should be logged.
|
92 | 140 | */
|
| 141 | + |
93 | 142 | 'interval_in_seconds' => 60,
|
94 | 143 |
|
95 | 144 | /*
|
96 | 145 | * When the clean-command is executed, all recorded statistics older than
|
97 | 146 | * the number of days specified here will be deleted.
|
98 | 147 | */
|
| 148 | + |
99 | 149 | 'delete_statistics_older_than_days' => 60,
|
100 | 150 |
|
101 | 151 | /*
|
102 | 152 | * Use an DNS resolver to make the requests to the statistics logger
|
103 | 153 | * default is to resolve everything to 127.0.0.1.
|
104 | 154 | */
|
105 |
| - 'perform_dns_lookup' => false, |
106 |
| - ], |
107 |
| - |
108 |
| - /* |
109 |
| - * Define the optional SSL context for your WebSocket connections. |
110 |
| - * You can see all available options at: http://php.net/manual/en/context.ssl.php |
111 |
| - */ |
112 |
| - 'ssl' => [ |
113 |
| - /* |
114 |
| - * Path to local certificate file on filesystem. It must be a PEM encoded file which |
115 |
| - * contains your certificate and private key. It can optionally contain the |
116 |
| - * certificate chain of issuers. The private key also may be contained |
117 |
| - * in a separate file specified by local_pk. |
118 |
| - */ |
119 |
| - 'local_cert' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT', null), |
120 |
| - |
121 |
| - /* |
122 |
| - * Path to local private key file on filesystem in case of separate files for |
123 |
| - * certificate (local_cert) and private key. |
124 |
| - */ |
125 |
| - 'local_pk' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_PK', null), |
126 | 155 |
|
127 |
| - /* |
128 |
| - * Passphrase for your local_cert file. |
129 |
| - */ |
130 |
| - 'passphrase' => env('LARAVEL_WEBSOCKETS_SSL_PASSPHRASE', null), |
| 156 | + 'perform_dns_lookup' => false, |
131 | 157 | ],
|
132 | 158 |
|
133 |
| - /* |
134 |
| - * Channel Manager |
135 |
| - * This class handles how channel persistence is handled. |
136 |
| - * By default, persistence is stored in an array by the running webserver. |
137 |
| - * The only requirement is that the class should implement |
138 |
| - * `ChannelManager` interface provided by this package. |
139 |
| - */ |
140 |
| - 'channel_manager' => \BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManagers\ArrayChannelManager::class, |
141 | 159 | ];
|
0 commit comments