Skip to content

Simplify usage by supporting new HTTP API and new Socket API #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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);
```
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/EventSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down