Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
39 lines (27 sloc) 789 Bytes
use React\HttpClient\Client;
use React\HttpClient\Response;
use React\Socket\FixedUriConnector;
use React\Socket\UnixConnector;
require __DIR__ . '/../vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
$connector = new FixedUriConnector(
new UnixConnector($loop)
$client = new Client($loop, $connector);
$request = $client->request('GET', 'http://localhost/info');
$request->on('response', function (Response $response) {
$response->on('data', function ($chunk) {
echo $chunk;
$response->on('end', function () {
echo 'DONE' . PHP_EOL;
$request->on('error', function (\Exception $e) {
echo $e;