Registry / networking / react-http

react-http

JSON →
library1.11.0phppackagistunverified

Event-driven, streaming HTTP client and server implementation for ReactPHP.

composer require react/http
INSTALL
IMPORT
SIG · REACT-HTTP
R
react-http
networkingphpv1.11.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Server
use React\Http\Server;

Creates a simple HTTP server that responds with 'Hello World'.

use React\Http\Server; use React\EventLoop\Factory; use Psr\Http\Message\ServerRequestInterface; $loop = Factory::create(); $server = new Server($loop, function (ServerRequestInterface $request) { return new React\Http\Response(200, ['Content-Type' => 'text/plain'], "Hello World\n"); }); $socket = new React\Socket\Server(8080, $loop); $server->listen($socket); $loop->run();
Debug
Known issues
breakingRequires PHP 7.4+ and ReactPHP event loop.
fix
Ensure PHP version is 7.4 or higher and install react/event-loop.
affects: >=1.0.0
Upgrade
Version history
1.11.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
31 hits · last 30 days
node
26
Amazon
1
OpenAI (training)
1
Resources
react-http — pip install react-http · libregistry