diff --git a/README.md b/README.md index bdc22a5..0d0f13c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Quality Score](https://img.shields.io/scrutinizer/g/beyondcode/laravel-websockets.svg?style=flat-square)](https://scrutinizer-ci.com/g/beyondcode/laravel-websockets) [![Total Downloads](https://img.shields.io/packagist/dt/beyondcode/laravel-websockets.svg?style=flat-square)](https://packagist.org/packages/beyondcode/laravel-websockets) -Bring the power of WebSockets to your Laravel application. Drop-in Pusher replacement, SSL support, Laravel Echo support and a debug dashboard are just some of it's features. +Bring the power of WebSockets to your Laravel application. Drop-in Pusher replacement, SSL support, Laravel Echo support and a debug dashboard are just some of its features. ## Installation @@ -31,7 +31,7 @@ To start the WebSocket server, use: php artisan websockets:serve ``` -For in-depth usage and deployment details, please take a look at the [official documentation](https://docs.beyondco.de/laravel-websockets/) +For in-depth usage and deployment details, please take a look at the [official documentation](https://docs.beyondco.de/laravel-websockets/). ### Changelog diff --git a/composer.json b/composer.json index a0b883e..c10f721 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "beyondcode/laravel-websockets", - "description": "", + "description": "An easy to use WebSocket server", "keywords": [ "beyondcode", "laravel-websockets" @@ -37,7 +37,7 @@ }, "require-dev": { "mockery/mockery": "^1.2", - "orchestra/testbench": "~3.5", + "orchestra/testbench": "3.7.*", "phpunit/phpunit": "^7.0" }, "autoload": { diff --git a/config/websockets.php b/config/websockets.php index 84315b5..508a0b0 100644 --- a/config/websockets.php +++ b/config/websockets.php @@ -2,12 +2,12 @@ return [ - /** + /* * This package comes with multi tenancy out of the box. Here you can * configure the different apps that can use the webSockets server. * * Optionally you can disable client events so clients cannot send - * messages through each other via the webSockets. + * messages to each other via the webSockets. */ 'apps' => [ [ @@ -20,18 +20,18 @@ return [ ], ], - /** + /* * This class is responsible for finding the apps. The default provider * will use the apps defined in this config file. * * You can create a custom provider by implementing the - * `appProvier` interface. + * `AppProvider` interface. */ 'app_provider' => BeyondCode\LaravelWebSockets\Apps\ConfigAppProvider::class, /* * This array contains the hosts of which you want to allow incoming requests. - * Leave this empty if you want to accepts requests from all hosts. + * Leave this empty if you want to accept requests from all hosts. */ 'allowed_origins' => [ // @@ -47,6 +47,26 @@ return [ */ 'path' => 'laravel-websockets', + 'statistics' => [ + /* + * This model will be used to store the statistics of the WebSocketsServer. + * The only requirement is that the model should extend + * `WebSocketsStatisticsEntry` provided by this package. + */ + 'model' => \BeyondCode\LaravelWebSockets\Statistics\Models\WebSocketsStatisticsEntry::class, + + /* + * Here you can specify the interval in seconds at which statistics should be logged. + */ + 'interval_in_seconds' => 60, + + /* + * When the clean-command is executed, all recorded statistics older than + * the number of days specified here will be deleted. + */ + 'delete_statistics_older_than_days' => 60 + ], + /* * Define the optional SSL context for your WebSocket connections. * You can see all available options at: http://php.net/manual/en/context.ssl.php @@ -67,28 +87,8 @@ return [ 'local_pk' => null, /* - * Passphrase with which your local_cert file was encoded. + * Passphrase for your local_cert file. */ 'passphrase' => null ], - - 'statistics' => [ - /* - * This model will be used to store the statistics of the WebSocketsServer. - * The only requirement is that the model should be or extend - * `WebSocketsStatisticsEntry` provided by this package. - */ - 'model' => \BeyondCode\LaravelWebSockets\Statistics\Models\WebSocketsStatisticsEntry::class, - - /* - * Here you can specify the interval in seconds at which statistics should be logged. - */ - 'interval_in_seconds' => 60, - - /* - * When the clean-command is executed, all recorded statistics older than - * the number of days specified here will be deleted. - */ - 'delete_statistics_older_than_days' => 60 - ], -]; \ No newline at end of file +]; diff --git a/src/Statistics/DnsResolver.php b/src/Statistics/DnsResolver.php index ae071d5..ef88616 100644 --- a/src/Statistics/DnsResolver.php +++ b/src/Statistics/DnsResolver.php @@ -8,11 +8,6 @@ use React\Promise\FulfilledPromise; class DnsResolver extends Resolver { - public function __construct() - { - // - } - public function resolve($domain) { return new FulfilledPromise('127.0.0.1');