spiral/roadrunner-http
PSR-7/PSR-17 compatible HTTP and HTTP/2 PHP workers for RoadRunner, the high-performance application server, load balancer, and process manager. Replace classic Nginx+FPM setups with greater performance and flexibility. Requires PHP 8.1+ and RoadRunner 2023.3+.
Install via Composer using the new package name — as of v4.2.0 the package is published as roadrunner/http (it was previously spiral/roadrunner-http):
composer require roadrunner/http
Two things to check immediately after bumping:
^4.1 until you upgrade..rr.yaml (RoadRunner 3 expects version: '3' and the http.pool/server key layout) and your binary/rr CLI to a v3 release before rolling this out.The package remains a thin PSR-7 bridge over the RoadRunner worker loop, so the PHP namespace you use in code is still Spiral\RoadRunner\Http\* (PSR7Worker, Request, Response, StreamFactory) — verify with composer show roadrunner/http and the refreshed README if your autoloader complains after the rename.
First use case in a Laravel app: you almost certainly don't call this package directly. Install laravel/octane and select the RoadRunner driver (php artisan octane:install --server=roadrunner), which wires PSR7Worker into public/index.php for you. Reach for the package directly only when you need a custom worker bootstrap or you're writing a standalone non-Octane service.
php artisan octane:start --server=roadrunner --watch gives you the worker loop; the package supplies the PSR7Worker that converts RoadRunner payloads into Psr\Http\Message\ServerRequestInterface and hands back a PSR-7 response. Your job is keeping controllers/services stateless and container bindings flushable.PSR7Worker with the RoadRunner worker + PSR-17 factories, then while ($request = $worker->waitRequest()) → pass to your kernel → $worker->respond($response). Wrap the kernel call in try/catch and respond with a 500 rather than letting the exception kill the worker silently.PSR7Worker takes Psr\Http\Message\ResponseFactoryInterface and StreamFactoryInterface in its constructor — nyholm/psr7 is the lightweight default, guzzlehttp/psr7 if you already ship it. Laravel's default HttpFoundation stack does not provide PSR-7, so don't assume it's there.octane's response handling carefully — buffered Octane responses still load the body.waitRequest()/respond() rather than forking the worker. In Octane, prefer Octane::tick() / listeners and app('events') hooks.http.pool (num_workers, max_jobs, allocate_timeout, destroy_timeout) and keep http.middleware (static, gzip, headers) in .rr.yaml so PHP never parses those requests.spiral/roadrunner-bridge handles provider bootstrapping automatically.composer require spiral/roadrunner-http now resolves the old, unmaintained line. Update composer.json, any Dockerfiles pinning the old name, and CI caches. If you have a replace/provide entry or a Composer patch, re-check it.rr v2, or vice versa) tends to surface as opaque worker-restart loops rather than a clear error — read rr serve -v output first.$request->getBody()->rewind() (or check tell() === 0) before the second read, or capture the contents early.echo/print/var_dump in a worker. Anything on stdout corrupts the RoadRunner protocol and shows up as a garbled response or a killed worker. Use logger() (RoadRunner RPC) or Laravel's log channel; use dump()/dd() only with Octane's debug tooling enabled.filterHeaders() (fixed in v4.2.0). Headers like 0 or 123 used to be dropped, which broke some webhook/proxy signatures. Remove any workaround you added that prefixed such headers with a string.http.debug: true in .rr.yaml logs request/response pairs — best first move for header mismatches and empty-body reports. For Octane, php artisan octane:status and the worker logs distinguish "application error" from "worker died".Octane::tick() cleanup or reset bindings in config/octane.php's warm/flush arrays.#[\Override] everywhere — harmless to consumers, but if you subclass PSR7Worker or the Request/Response classes, ensure your method signatures still match; a mismatch now fails at class-load with a clearer fatal error instead of a silent mismatch.PSR7Worker accepts custom PSR-17 factories and error handling around waitRequest(); for deeper hooks (metrics, tracing) prefer decorating the worker or handling it at the RoadRunner middleware/RPC layer rather than patching the package.How can I help you explore Laravel packages today?