Registry / networking / amphp-http-server

amphp-http-server

JSON →
library3.4.5phppackagistunverified

A non-blocking HTTP application server for PHP based on Amp.

composer require amphp/http-server
INSTALL
IMPORT
SIG · AMPHP-HTTP-SERVER
A
amphp-http-server
networkingphpv3.4.5
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.

HttpServer
use Amp\Http\Server\HttpServer;

Start a simple HTTP server responding with 'Hello!'

use Amp\Http\Server\HttpServer; use Amp\Http\Server\RequestHandler\CallableRequestHandler; use Amp\Http\Server\SocketHttpServer; use Amp\Loop; $server = new SocketHttpServer(); $server->start(new CallableRequestHandler(function ($request) { return new \Amp\Http\Server\Response(200, ['content-type' => 'text/plain'], 'Hello!'); }), new \Amp\Socket\ServerAddress('0.0.0.0:8080')); Loop::run();
Debug
Known issues
breakingRequires amphp/amp and amphp/socket
fix
Install required packages: composer require amphp/amp amphp/socket
affects: *
Upgrade
Version history
3.4.5latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
40 hits · last 30 days
node
36
OpenAI (training)
1
Resources
amphp-http-server — pip install amphp-http-server · libregistry