Skip to content

Commit

Permalink
Merge pull request #654 from andig/react-0.8-2
Browse files Browse the repository at this point in the history
Upgrade react/http
  • Loading branch information
andig committed Dec 19, 2017
2 parents afe25de + 6ab4a70 commit 52d860f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -21,7 +21,7 @@
"symfony/http-foundation": "^2.6|^3.0",
"symfony/routing": "^2.6|^3.0",
"cboden/ratchet": "^0.4",
"react/http": "dev-master",
"react/http": "^0.8",
"php-pm/php-pm": "dev-master",
"php-pm/httpkernel-adapter": "dev-master"
},
Expand Down
11 changes: 2 additions & 9 deletions lib/Server/HttpReceiver.php
Expand Up @@ -25,9 +25,7 @@
namespace Volkszaehler\Server;

use React\Socket\Server as SocketServer;
use React\Http\StreamingServer as HttpServer;
use React\Http\Middleware;
use React\Http\MiddlewareRunner;
use React\Http\Server as HttpServer;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use RingCentral\Psr7;
Expand All @@ -50,12 +48,7 @@ class HttpReceiver {
function __construct(SocketServer $socket, MiddlewareAdapter $hub) {
$this->hub = $hub;

$middleware = new MiddlewareRunner([
new Middleware\RequestBodyBufferMiddleware(),
[$this, 'handleRequest']
]);

$this->http = new HttpServer($middleware);
$this->http = new HttpServer([$this, 'handleRequest']);
$this->http->listen($socket);
}

Expand Down

0 comments on commit 52d860f

Please sign in to comment.