Skip to content

Commit 8ca8624

Browse files
authored
Merge pull request #23 from clue-labs/http
Simplify usage by supporting new HTTP API and new Socket API
2 parents d5a88ba + 79e9541 commit 8ca8624

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ to the [`Browser`](https://github.com/reactphp/http#browser) instance
6262
and pass it as an additional argument to the `EventSource` like this:
6363

6464
```php
65-
$connector = new React\Socket\Connector(null, [
65+
$connector = new React\Socket\Connector([
6666
'dns' => '127.0.0.1',
6767
'tcp' => [
6868
'bindto' => '192.168.10.1:0'
@@ -72,7 +72,7 @@ $connector = new React\Socket\Connector(null, [
7272
'verify_peer_name' => false
7373
]
7474
]);
75-
$browser = new React\Http\Browser(null, $connector);
75+
$browser = new React\Http\Browser($connector);
7676

7777
$es = new Clue\React\EventSource\EventSource('https://example.com/stream.php', null, $browser);
7878
```

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"php": ">=5.4",
1515
"evenement/evenement": "^3.0 || ^2.0",
1616
"react/event-loop": "^1.2",
17-
"react/http": "^1.4"
17+
"react/http": "^1.5"
1818
},
1919
"require-dev": {
2020
"phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35"

src/EventSource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function __construct($url, LoopInterface $loop = null, Browser $browser =
9696

9797
$this->loop = $loop ?: Loop::get();
9898
if ($browser === null) {
99-
$browser = new Browser($this->loop);
99+
$browser = new Browser(null, $this->loop);
100100
}
101101
$this->browser = $browser->withRejectErrorResponse(false);
102102
$this->url = $url;

0 commit comments

Comments
 (0)