diff --git a/composer.json b/composer.json index d44c8aa..5ce3d18 100644 --- a/composer.json +++ b/composer.json @@ -7,14 +7,21 @@ "require": { "php": ">=5.5.9", "ext-zmq": "*", - "laravel/framework": "5.*", - "cboden/ratchet": "^0.3", - "graham-campbell/throttle": "^5.2", + "laravel/framework": "5.5.*", + "cboden/ratchet": "^0.4", + "graham-campbell/throttle": "^6.0", "react/zmq": "0.2.*|0.3.*" - }, + }, "autoload": { "psr-4": { "Askedio\\LaravelRatchet\\": "src/" } + }, + "extra": { + "laravel": { + "providers": [ + "Askedio\\LaravelRatchet\\Providers\\LaravelRatchetServiceProvider" + ] + } } } diff --git a/src/Console/Commands/RatchetServerCommand.php b/src/Console/Commands/RatchetServerCommand.php index 09fea41..35d89ff 100644 --- a/src/Console/Commands/RatchetServerCommand.php +++ b/src/Console/Commands/RatchetServerCommand.php @@ -50,6 +50,11 @@ public function __construct() parent::__construct(); } + public function handle() + { + $this->fire(); + } + /** * Execute the console command. * @@ -132,8 +137,7 @@ private function startWampServer() }); - $webSock = new \React\Socket\Server($loop); - $webSock->listen($this->port, $this->host); + $webSock = new \React\Socket\Server($this->host.':'.$this->port, $loop); $webServer = new \Ratchet\Server\IoServer( new \Ratchet\Http\HttpServer( new \Ratchet\WebSocket\WsServer( diff --git a/src/RatchetServer.php b/src/RatchetServer.php index b9b489d..f731121 100644 --- a/src/RatchetServer.php +++ b/src/RatchetServer.php @@ -124,10 +124,14 @@ private function isThrottled($conn, $setting) { $connectionThrottle = explode(':', config(sprintf('ratchet.throttle.%s', $setting))); - return !Throttle::attempt([ - 'ip' => $conn->remoteAddress, - 'route' => $setting, - ], $connectionThrottle[0], $connectionThrottle[1]); + return !Throttle::attempt( + [ + 'ip' => $conn->remoteAddress, + 'route' => $setting, + ], + (int) $connectionThrottle[0], + (int) $connectionThrottle[1] + ); } /**