diff --git a/README.md b/README.md index d3b88d6..b967d8d 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ to the [`Browser`](https://github.com/reactphp/http#browser) instance and pass it as an additional argument to the `EventSource` like this: ```php -$connector = new React\Socket\Connector(null, [ +$connector = new React\Socket\Connector([ 'dns' => '127.0.0.1', 'tcp' => [ 'bindto' => '192.168.10.1:0' @@ -72,7 +72,7 @@ $connector = new React\Socket\Connector(null, [ 'verify_peer_name' => false ] ]); -$browser = new React\Http\Browser(null, $connector); +$browser = new React\Http\Browser($connector); $es = new Clue\React\EventSource\EventSource('https://example.com/stream.php', null, $browser); ``` diff --git a/composer.json b/composer.json index 820b55f..8e42707 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "php": ">=5.4", "evenement/evenement": "^3.0 || ^2.0", "react/event-loop": "^1.2", - "react/http": "^1.4" + "react/http": "^1.5" }, "require-dev": { "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" diff --git a/src/EventSource.php b/src/EventSource.php index 6ba400b..d85d166 100644 --- a/src/EventSource.php +++ b/src/EventSource.php @@ -96,7 +96,7 @@ public function __construct($url, LoopInterface $loop = null, Browser $browser = $this->loop = $loop ?: Loop::get(); if ($browser === null) { - $browser = new Browser($this->loop); + $browser = new Browser(null, $this->loop); } $this->browser = $browser->withRejectErrorResponse(false); $this->url = $url;