|
56 | 56 | */
|
57 | 57 |
|
58 | 58 | 'channel' => \BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManagers\ArrayChannelManager::class,
|
| 59 | + |
59 | 60 | ],
|
60 | 61 |
|
61 | 62 | /*
|
62 |
| - * This package comes with multi tenancy out of the box. Here you can |
63 |
| - * configure the different apps that can use the webSockets server. |
64 |
| - * |
65 |
| - * Optionally you specify capacity so you can limit the maximum |
66 |
| - * concurrent connections for a specific app. |
67 |
| - * |
68 |
| - * Optionally you can disable client events so clients cannot send |
69 |
| - * messages to each other via the webSockets. |
70 |
| - */ |
| 63 | + |-------------------------------------------------------------------------- |
| 64 | + | Applications Repository |
| 65 | + |-------------------------------------------------------------------------- |
| 66 | + | |
| 67 | + | By default, the only allowed app is the one you define with |
| 68 | + | your PUSHER_* variables from .env. |
| 69 | + | You can configure to use multiple apps if you need to, or use |
| 70 | + | a custom App Manager that will handle the apps from a database, per se. |
| 71 | + | |
| 72 | + | You can apply multiple settings, like the maximum capacity, enable |
| 73 | + | client-to-client messages or statistics. |
| 74 | + | |
| 75 | + */ |
| 76 | + |
71 | 77 | 'apps' => [
|
72 | 78 | [
|
73 | 79 | 'id' => env('PUSHER_APP_ID'),
|
|
82 | 88 | ],
|
83 | 89 |
|
84 | 90 | /*
|
85 |
| - * This array contains the hosts of which you want to allow incoming requests. |
86 |
| - * Leave this empty if you want to accept requests from all hosts. |
87 |
| - */ |
| 91 | + |-------------------------------------------------------------------------- |
| 92 | + | Allowed Origins |
| 93 | + |-------------------------------------------------------------------------- |
| 94 | + | |
| 95 | + | If not empty, you can whitelist certain origins that will be allowed |
| 96 | + | to connect to the websocket server. |
| 97 | + | |
| 98 | + */ |
| 99 | + |
88 | 100 | 'allowed_origins' => [
|
89 | 101 | //
|
90 | 102 | ],
|
91 | 103 |
|
92 | 104 | /*
|
93 |
| - * The maximum request size in kilobytes that is allowed for an incoming WebSocket request. |
94 |
| - */ |
| 105 | + |-------------------------------------------------------------------------- |
| 106 | + | Maximum Request Size |
| 107 | + |-------------------------------------------------------------------------- |
| 108 | + | |
| 109 | + | The maximum request size in kilobytes that is allowed for |
| 110 | + | an incoming WebSocket request. |
| 111 | + | |
| 112 | + */ |
| 113 | + |
95 | 114 | 'max_request_size_in_kb' => 250,
|
96 | 115 |
|
97 | 116 | /*
|
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 |
100 |
| - */ |
| 117 | + |-------------------------------------------------------------------------- |
| 118 | + | SSL Configuration |
| 119 | + |-------------------------------------------------------------------------- |
| 120 | + | |
| 121 | + | By default, the configuration allows only on HTTP. For SSL, you need |
| 122 | + | to set up the the certificate, the key, and optionally, the passphrase |
| 123 | + | for the private key. |
| 124 | + | You will need to restart the server for the settings to take place. |
| 125 | + | |
| 126 | + */ |
| 127 | + |
101 | 128 | '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 |
| - */ |
| 129 | + |
108 | 130 | 'local_cert' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT', null),
|
109 | 131 |
|
110 |
| - /* |
111 |
| - * Path to local private key file on filesystem in case of separate files for |
112 |
| - * certificate (local_cert) and private key. |
113 |
| - */ |
| 132 | + 'capath' => env('LARAVEL_WEBSOCKETS_SSL_CA', null), |
| 133 | + |
114 | 134 | 'local_pk' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_PK', null),
|
115 | 135 |
|
116 |
| - /* |
117 |
| - * Passphrase for your local_cert file. |
118 |
| - */ |
119 | 136 | 'passphrase' => env('LARAVEL_WEBSOCKETS_SSL_PASSPHRASE', null),
|
| 137 | + |
| 138 | + 'verify_peer' => env('APP_ENV') === 'production', |
| 139 | + |
| 140 | + 'allow_self_signed' => env('APP_ENV') !== 'production', |
| 141 | + |
120 | 142 | ],
|
121 | 143 |
|
122 | 144 | 'statistics' => [
|
123 | 145 |
|
124 | 146 | /*
|
125 |
| - * This model will be used to store the statistics of the WebSocketsServer. |
126 |
| - * The only requirement is that the model should extend |
127 |
| - * `WebSocketsStatisticsEntry` provided by this package. |
128 |
| - */ |
| 147 | + |-------------------------------------------------------------------------- |
| 148 | + | Statistics Eloquent Model |
| 149 | + |-------------------------------------------------------------------------- |
| 150 | + | |
| 151 | + | This model will be used to store the statistics of the WebSocketsServer. |
| 152 | + | The only requirement is that the model should extend |
| 153 | + | `WebSocketsStatisticsEntry` provided by this package. |
| 154 | + | |
| 155 | + */ |
| 156 | + |
129 | 157 | 'model' => \BeyondCode\LaravelWebSockets\Statistics\Models\WebSocketsStatisticsEntry::class,
|
130 | 158 |
|
131 |
| - /** |
132 |
| - * The Statistics Logger will, by default, handle the incoming statistics, store them |
133 |
| - * and then release them into the database on each interval defined below. |
134 |
| - */ |
| 159 | + /* |
| 160 | + |-------------------------------------------------------------------------- |
| 161 | + | Statistics Logger Handler |
| 162 | + |-------------------------------------------------------------------------- |
| 163 | + | |
| 164 | + | The Statistics Logger will, by default, handle the incoming statistics, |
| 165 | + | store them into an array and then store them into the database |
| 166 | + | on each interval. |
| 167 | + | |
| 168 | + */ |
135 | 169 |
|
136 | 170 | 'logger' => \BeyondCode\LaravelWebSockets\Statistics\Logger::class,
|
137 | 171 |
|
138 | 172 | /*
|
139 |
| - * Here you can specify the interval in seconds at which statistics should be logged. |
140 |
| - */ |
| 173 | + |-------------------------------------------------------------------------- |
| 174 | + | Statistics Interval Period |
| 175 | + |-------------------------------------------------------------------------- |
| 176 | + | |
| 177 | + | Here you can specify the interval in seconds at which |
| 178 | + | statistics should be logged. |
| 179 | + | |
| 180 | + */ |
141 | 181 |
|
142 | 182 | 'interval_in_seconds' => 60,
|
143 | 183 |
|
144 | 184 | /*
|
145 |
| - * When the clean-command is executed, all recorded statistics older than |
146 |
| - * the number of days specified here will be deleted. |
147 |
| - */ |
| 185 | + |-------------------------------------------------------------------------- |
| 186 | + | Statistics Deletion Period |
| 187 | + |-------------------------------------------------------------------------- |
| 188 | + | |
| 189 | + | When the clean-command is executed, all recorded statistics older than |
| 190 | + | the number of days specified here will be deleted. |
| 191 | + | |
| 192 | + */ |
148 | 193 |
|
149 | 194 | 'delete_statistics_older_than_days' => 60,
|
150 | 195 |
|
151 | 196 | /*
|
152 |
| - * Use an DNS resolver to make the requests to the statistics logger |
153 |
| - * default is to resolve everything to 127.0.0.1. |
154 |
| - */ |
| 197 | + |-------------------------------------------------------------------------- |
| 198 | + | DNS Lookup |
| 199 | + |-------------------------------------------------------------------------- |
| 200 | + | |
| 201 | + | Use an DNS resolver to make the requests to the statistics logger |
| 202 | + | default is to resolve everything to 127.0.0.1. |
| 203 | + | |
| 204 | + */ |
155 | 205 |
|
156 | 206 | 'perform_dns_lookup' => false,
|
| 207 | + |
| 208 | + /* |
| 209 | + |-------------------------------------------------------------------------- |
| 210 | + | DNS Lookup TLS Settings |
| 211 | + |-------------------------------------------------------------------------- |
| 212 | + | |
| 213 | + | You can configure the DNS Lookup Connector the TLS settings. |
| 214 | + | Check the available options here: |
| 215 | + | https://github.com/reactphp/socket/blob/master/src/Connector.php#L29 |
| 216 | + | |
| 217 | + */ |
| 218 | + |
| 219 | + 'tls' => [ |
| 220 | + |
| 221 | + 'verify_peer' => env('APP_ENV') === 'production', |
| 222 | + |
| 223 | + 'verify_peer_name' => env('APP_ENV') === 'production', |
| 224 | + |
| 225 | + ], |
| 226 | + |
157 | 227 | ],
|
158 | 228 |
|
159 | 229 | ];
|
0 commit comments