Awesome
Awesome PSR-15 Middlewares <img src="https://avatars1.githubusercontent.com/u/22275359?v=3&s=200" width="200" align="right" alt="MW">
PSR-15 HTTP Middleware describes a common standard for HTTP middleware components using HTTP Messages defined by PSR-7.
Currently, PSR-15 is a PHP Standards Recommendation of the Framework Interoperability Group (FIG).
Please read the contribution guidelines before contributing.
Contents
References
- PHP Framework Interoperability Group website
- PSR-15 HTTP Middleware - The current standard.
- psr/http-server-middleware - Composer package of common interfaces for PSR-15 HTTP Middlewares.
Articles
- PSR-7 Objects Are Not Immutable - Description of a serious flaw with the double-pass style of middlewares.
- Dependency Inversion and PSR-7 Bodies - Conclusion that double-pass flaws cannot be resolved without HTTP Factories.
Packages
PSR-7 implementations
- laminas/laminas-diactoros
- guzlehttp/psr7
- slim/http
- nyholm/psr7
- sunrise/http-message
- sunrise/http-server-request
- sunrise/stream
- sunrise/uri
- http_message (PHP extension)
- httpsoft/http-message
Dispatcher
- relay/relay - A PSR-15 request handler for both PSR-15 and callable middleware; use it with any framework or container.
- equip/dispatch - An HTTP Interop compatible middleware dispatcher.
- mindplay/middleman - Dead simple PSR-15 / PSR-7 middleware dispatcher.
- laminas/laminas-stratigility - Build and dispatch middleware pipelines.
- oscarotero/middleland - Another PSR-15 dispatcher
- moon-php/http-middleware - A simple PSR-15 dispatcher with lazy middleware resolution via container
- northwoods/broker - A conditional PSR-15 dispatcher that supports lazy middleware resolution via container
- noglitchyo/middleware-collection-request-handler - Lightweight & simple PSR-15 server request handler implementation to handle middleware collection.
- makise-co/middleware - A high performance strict typed PSR-15 dispatcher that supports middleware resolution though PSR container. Optimized for long-running applications (like Swoole, ReactPHP, AmPHP).
- httpsoft/http-runner - Running PSR-7 components and building PSR-15 middleware pipelines.
Router
- middlewares/aura-router - Use Aura.Router.
- middlewares/fast-route - Use FastRoute.
- timtegeler/routerunner - Routerunner is a config-driven router for HTTP requests.
- delolmo/symfony-router - Use symfony/routing
- sunrise/http-router - HTTP Router based on PSR-7 and PSR-15
- jasny/switch-route - Generate a PHP script for faster routing
- makise-co/http-router - A HTTP Router based on FastRoute with middleware and DI support. Optimized for long-running applications.
- httpsoft/http-router - Simple and fast HTTP request router providing PSR-7 and PSR-15.
Security
- middlewares/cors - Manage Cross-Origin Resource Sharing (CORS).
- middlewares/csp - Manage Content-Security-Policies (CSP).
- middlewares/honeypot - Block spam bots.
- middlewares/http-authentication - HTTP Basic and Digest access authentication.
- middlewares/recaptcha - Use Google's reCAPTCHA for spam prevention.
- ellipsephp/cookie-encryption - Encrypt cookies with a key
Development
- middlewares/debugbar - Inject PHP Debug Bar.
- middlewares/whoops - Use Whoops as error handler.
Manage States
- middlewares/aura-session - Manage sessions using Aura.Session.
Content
- middlewares/encoder - Compress responses with gzencode or gzdeflate.
- middlewares/minifier - Minify Html, CSS and Javascript.
- middlewares/negotiation - Manage content negotiations.
Miscellaneous
- middlewares/geolocation - Geolocate requests.
- noglitchyo/dealdoh - Handle DoH (DNS-over-HTTPS) messages.
License
To the extent possible under law, Michael Mayer has waived all copyright and related or neighboring rights to this work.