PHPackages                             for/http-middleware-psr15-adapter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. for/http-middleware-psr15-adapter

ActiveLibrary[HTTP &amp; Networking](/categories/http)

for/http-middleware-psr15-adapter
=================================

PSR15 adapter for react/http middleware

v2.0.0(3y ago)2512.2k33MITPHPPHP ^8.1

Since Dec 22Pushed 3y ago7 watchersCompare

[ Source](https://github.com/friends-of-reactphp/http-middleware-psr15-adapter)[ Packagist](https://packagist.org/packages/for/http-middleware-psr15-adapter)[ RSS](/packages/for-http-middleware-psr15-adapter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (11)Used By (3)

A PSR-15 middleware adapter for react/http
==========================================

[](#a-psr-15-middleware-adapter-for-reacthttp)

[![CI status](https://github.com/friends-of-reactphp/http-middleware-psr15-adapter/workflows/CI/badge.svg)](https://github.com/friends-of-reactphp/http-middleware-psr15-adapter/actions)

Wraps PSR-15 middleware using `async` and `await` from `react/async` utilizing fibers making them usable within `react/http` as middleware.

Install
=======

[](#install)

To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.

```
composer require for/http-middleware-psr15-adapter

```

Usage
=====

[](#usage)

The following usage example uses [`middlewares/redirect`](https://github.com/middlewares/redirect) adding one redirect, and using the callback to call several methods on the redirect middleware to change it's behavior:

```
$server = new Server(
    /** Other middleware */
    new PSR15Middleware(
        (new Redirect(['/old-url' => '/new-url']))->permanent(false)->query(false)->method(['GET', 'POST'])
    ),
    /** Other middleware */
);
```

Grouped Usage
=============

[](#grouped-usage)

When using more then one PSR-15 in a row the `GroupedPSR15Middleware` is more performing than using multiple `PSR15Middleware`. Consider the following example where we add [`middlewares/cache`](https://github.com/middlewares/cache) for expires headers:

```
$loop = Factory::create();
$server = new Server([
    /** Other middleware */
    (new GroupedPSR15Middleware($loop))->withMiddleware(
        (new Redirect(['/old-url' => '/new-url']))->permanent(false)->query(false)->method(['GET', 'POST'])
    )->withMiddleware(
        new Expires()
    ),
    /** Other middleware */
]);
```

###  Health Score

41

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~188 days

Recently: every ~424 days

Total

10

Last Release

1363d ago

Major Versions

v0.3.1 → v1.0.02018-01-24

v1.0.1 → v2.0.02022-08-14

PHP version history (2 changes)v0.2.0PHP ^7.0

v2.0.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/147145?v=4)[Cees-Jan Kiewiet](/maintainers/WyriHaximus)[@WyriHaximus](https://github.com/WyriHaximus)

![](https://avatars.githubusercontent.com/u/776829?v=4)[Christian Lück](/maintainers/clue)[@clue](https://github.com/clue)

![](https://www.gravatar.com/avatar/5de14776bbddf901c6e24d35829fe66fe997c303d53aca83cc7d1a90bb0b7110?d=identicon)[jsor](/maintainers/jsor)

---

Top Contributors

[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (47 commits)")

---

Tags

httpmiddlewarephpphp7psrpsr-15reactphphttphttpsmiddlewarereactphppsr15

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/for-http-middleware-psr15-adapter/health.svg)

```
[![Health](https://phpackages.com/badges/for-http-middleware-psr15-adapter/health.svg)](https://phpackages.com/packages/for-http-middleware-psr15-adapter)
```

###  Alternatives

[league/uri

URI manipulation library

1.1k206.4M276](/packages/league-uri)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)[mezzio/mezzio

PSR-15 Middleware Microframework

3883.6M97](/packages/mezzio-mezzio)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

586.6M81](/packages/laminas-laminas-stratigility)[middlewares/utils

Common utils for PSR-15 middleware packages

503.4M93](/packages/middlewares-utils)[northwoods/broker

Dead simple PSR-15 middleware dispatcher

27101.3k3](/packages/northwoods-broker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
