RoadRunner HTTP

PSR-7/PSR-17 worker client that bridges RoadRunner's Go HTTP server to standard PHP request objects

Library
Composer
vv4.1.0
80stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
38/100Needs Attention
Development Activity4
Maintenance32
Community36
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
72/100Good
Architecture76
Code Quality78
Innovation62
Learning Curve70

RoadRunner HTTP is the PHP-side library that PSR-7-compliant frameworks and applications use to receive requests from the RoadRunner Go server. Its PSR7Worker class reads the binary request payload RoadRunner passes to a PHP worker, converts it into a standard PSR-7 ServerRequestInterface, and serializes the framework’s PSR-7 response back into the format RoadRunner expects to send to the client.

It depends on spiral/roadrunner-worker for the underlying worker/RPC transport and roadrunner-php/roadrunner-api-dto for protocol data structures, and works with any PSR-17 HTTP factory implementation (such as nyholm/psr7), making it a thin, framework-agnostic adapter layer rather than a full HTTP framework.

What You Get

  • PSR7Worker / PSR7WorkerInterface to convert RoadRunner’s binary protocol into PSR-7 ServerRequestInterface objects and back
  • HttpWorker / HttpWorkerInterface for lower-level access to the RoadRunner HTTP worker loop
  • GlobalState handling to populate PHP superglobals ($_SERVER, $_GET, etc.) consistently per request
  • Exception types for handling malformed requests and worker-protocol errors
  • Compatibility with any PSR-17 HTTP factory implementation (e.g. nyholm/psr7) for request/response object creation

Common Use Cases

  • Wiring a PSR-15-compliant PHP framework (Laravel, Symfony, Slim) to run under the RoadRunner application server
  • Building a custom lightweight PHP application that speaks directly to RoadRunner without a full framework
  • Implementing framework integration packages that need a standards-based bridge to RoadRunner’s worker protocol

Under The Hood

Architecture — The library centers on src/PSR7Worker.php, which wraps an HttpWorker (src/HttpWorker.php) and a PSR-17 factory to convert RoadRunner’s binary request payloads into ServerRequestInterface objects and PSR-7 responses back into RoadRunner’s wire format; src/GlobalState.php handles PHP superglobal population so legacy code relying on $_SERVER/$_GET continues to work under the worker model. Tech Stack — PHP 8.1+, depending on psr/http-message and psr/http-factory for the PSR-7/17 contracts, spiral/roadrunner and spiral/roadrunner-worker for the underlying RPC transport, and roadrunner-php/roadrunner-api-dto for protocol DTOs; nyholm/psr7 is used as the PSR-17 implementation in tests. Code Quality — Tests are organized into tests/Unit, tests/Feature, and tests/Server directories, run via PHPUnit 10.5 with coverage reporting (test:cc script), and Psalm with a checked-in baseline enforces static-analysis discipline; php-cs-fixer keeps style consistent. API Design — The PSR7WorkerInterface contract is small and framework-agnostic — one method to wait for the next request, one to respond — so any PSR-15 middleware stack or custom router can sit on top of it with minimal glue code.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search