swokit / http-server
some http server tool library of the swoole
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/swokit/http-server
Requires
- php: >7.0.0
- inhere/http: ^1.0
- inhere/server: dev-master
- swoole-kit/context: ~1.0
Suggests
- inhere/console: a lightweight php console application library.
- inhere/php-validate: Very lightweight data validate tool
This package is auto-updated.
Last update: 2025-09-29 02:08:55 UTC
README
Quick Start
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Swokit\Http\Serer\HttpServer; use Swokit\Http\Serer\Util\ClosureWrapper; use PhpComp\Http\Message\HttpFactory; $http = new HttpServer([ // ]); $http->setRequestHandler(ClosureWrapper::create(function(ServerRequestInterface $r): ResponseInterface { $psr7res = HttpFactory::createResponse(); $psr7res->write('hello. URI: '. (string)$r->getUri()); return $psr7res; })); $http->run();
license
MIT