Skip to content

Commit

Permalink
Merge pull request #15 from simonhamp/master
Browse files Browse the repository at this point in the history
Upgrade for Laravel 5.5
  • Loading branch information
gcphost authored Nov 8, 2017
2 parents 43f33df + 703d93c commit face671
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
15 changes: 11 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
}
8 changes: 6 additions & 2 deletions src/Console/Commands/RatchetServerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public function __construct()
parent::__construct();
}

public function handle()
{
$this->fire();
}

/**
* Execute the console command.
*
Expand Down Expand Up @@ -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(
Expand Down
12 changes: 8 additions & 4 deletions src/RatchetServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]
);
}

/**
Expand Down

0 comments on commit face671

Please sign in to comment.