PHPackages                             waiter-http/waiter - 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. waiter-http/waiter

ActiveLibrary

waiter-http/waiter
==================

A not so elegant HTTP server written in PHP

10PHP

Since Aug 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dragonmantank/waiter-http)[ Packagist](https://packagist.org/packages/waiter-http/waiter)[ RSS](/packages/waiter-http-waiter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Waiter HTTP Server
==================

[](#waiter-http-server)

#### An inelegant HTTP server written in PHP

[](#an-inelegant-http-server-written-in-php)

Let's marry an HTTP server and direct access to PHP code. What's the harm?

Installation
------------

[](#installation)

Installation is done using composer:

```
composer require waiter-http/waiter
```

### Requirements

[](#requirements)

- PHP 8.1 or higher
- A PSR-15 compatible middleware stack to handle the request

Usage
-----

[](#usage)

Waiter HTTP Server is a small, single threaded HTTP server that creates a PSR-15 compatible request object, passes it off to a PSR-15 compatible handler, and returns the response back to a client. You define the IP, port, and public file directory, pass it a middleware handler, and let the system go from there.

For example, you can use [pocket-framework/framework](https://github.com/dragonmantank/pocket-framework)to define your routes and actions/controllers, and pass the framework application to Waiter.

```
// public/index.php
use DI\ContainerBuilder;
use Waiter\Waiter\Server;
use FastRoute\RouteCollector;
use PocketFramework\Framework\Application;
use PocketFramework\Framework\Router\RouteProcessor;

require_once __DIR__ . '/../vendor/autoload.php';

// Bootstrap Pocket Framework
$container = (new ContainerBuilder())->build();
$dispatcher = FastRoute\simpleDispatcher(function (RouteCollector $r) {
    $processor = new RouteProcessor(realpath(__DIR__ . '/../src/HTTP/'), 'Dragonmantank\\MyApp\\HTTP\\');
    $processor->addRoutes($r);
});
$app = new Application($dispatcher, $container);

// Create the HTTP server and pass it the Pocket Framework instance
$waiter = new Server('127.0.0.1', 3000, __DIR__);
$waiter->setHandler($app);
$waiter->run();
```

In the above example, Waiter will listen on the `127.0.0.1` IP address on port 3000. It will then wait until an HTTP request comes in. The text is converted into a PSR-7 Request thanks to [laminas/laminas-diactoros](https://github.com/laminas/laminas-diactoros). The Request is passed to any PSR-15 compatible middleware runner, which in this case is being provided by Pocket Framework. Pocket Framework will return a PSR-7 Response object, and Waiter will deserialize the object back to text and return it to the client.

Waiter is able to handle concurrent connections so is partially async. More work needs to be done to make it more async. Depending on the actual PSR-15 handler, Waiter has shown to handle up to 300 concurrent connections with synthetic tests and a minimal routing set.

Configuration
-------------

[](#configuration)

Waiter takes three configuration parameters to it's `Server` object:

- `$listenAddress` - The IP address to bind to and list for socket connections
- `$listenPortNumber` - The port to listen for a connection on
- `$publicAssets` - Directory where static, public assets will be searched for

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c2583b67d4e1a4ade23b6ce271980d18bf3facb4ea3f0610fded770f380d17d?d=identicon)[dragonmantank](/maintainers/dragonmantank)

---

Top Contributors

[![dragonmantank](https://avatars.githubusercontent.com/u/108948?v=4)](https://github.com/dragonmantank "dragonmantank (3 commits)")

### Embed Badge

![Health badge](/badges/waiter-http-waiter/health.svg)

```
[![Health](https://phpackages.com/badges/waiter-http-waiter/health.svg)](https://phpackages.com/packages/waiter-http-waiter)
```

PHPackages © 2026

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