HTTP adapter for Triangle applications. It connects request handling to Localzet Server 7, Triangle Router, and Middleware; the application bootstrap remains responsible for configuration, routes, and listener startup.
Release 3.x targets PHP 8.1+, Localzet Server 7.1+, Triangle Engine 9, Router 2, Middleware 2, and the PHP cURL extension. Release 2.x remains on the earlier Engine compatibility line. Do not mix the two dependency sets in one lock file.
composer require triangle/engine-http:^3.0Follow the installation guide for the complete bootstrap and version checks.
Register routes before collecting the Router dispatcher:
use localzet\Server\Protocols\Http\Response;
use Triangle\Router;
Router::any('/health', static fn () => new Response(
200,
['Content-Type' => 'application/json'],
'{"status":"ok"}',
));
Router::collect([]);Engine HTTP sends requests through route middleware and controller resolution. A Localzet Server HTTP response keeps its status, headers, and body. Other return values become a 200 response with a string body.
- Authentication and authorization belong to the application or its middleware.
- CORS is not enabled by default. Configure
app.http_headerswith explicit origins and headers when cross-origin access is required. - PHP files under a public path are disabled by default; enable them only when the application has a clear need and a reviewable execution boundary.
- Listener, HTTP framing, worker lifecycle, and backpressure are provided by Localzet Server.
See the request guide, configuration, and security guide for production setup.
composer validate --strict --no-check-publish --no-interaction
composer run test --no-interaction
composer audit --abandoned=reportThe test command covers response compatibility and a loopback HTTP request against Server 7.
AGPL-3.0-or-later. See LICENSE.