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

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

thruster/http-server
====================

Thruster HttpServer Component

0.4.0(9y ago)2323[1 issues](https://github.com/ThrusterIO/http-server/issues)MITPHPPHP &gt;=7.0

Since Jan 10Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ThrusterIO/http-server)[ Packagist](https://packagist.org/packages/thruster/http-server)[ Docs](https://thruster.io)[ RSS](/packages/thruster-http-server/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (8)Versions (5)Used By (0)

HttpServer Component
====================

[](#httpserver-component)

\[[![Latest Version](https://camo.githubusercontent.com/a533abb1d9c7c28a7106b2b6483f00a9f50a7bfae3ea3875796e5bd341464230/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f5468727573746572494f2f687474702d7365727665722e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/a533abb1d9c7c28a7106b2b6483f00a9f50a7bfae3ea3875796e5bd341464230/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f5468727573746572494f2f687474702d7365727665722e7376673f7374796c653d666c61742d737175617265)\] () \[[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)\] (LICENSE) \[[![Build Status](https://camo.githubusercontent.com/bb9558361c71483fa5006c25312dfcdeea4ba0d06b34523f4cba21d8991d82bc/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f5468727573746572494f2f687474702d7365727665722e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/bb9558361c71483fa5006c25312dfcdeea4ba0d06b34523f4cba21d8991d82bc/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f5468727573746572494f2f687474702d7365727665722e7376673f7374796c653d666c61742d737175617265)\] () \[[![Code Coverage](https://camo.githubusercontent.com/2b2519afe872773d4a8ce917a05ea59d12f32d012ead273c4ac1913731a44907/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f5468727573746572494f2f687474702d7365727665722e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/2b2519afe872773d4a8ce917a05ea59d12f32d012ead273c4ac1913731a44907/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f5468727573746572494f2f687474702d7365727665722e7376673f7374796c653d666c61742d737175617265)\] () \[[![Quality Score](https://camo.githubusercontent.com/5e282561f24fcf149c486366bd546698583d38da793e8a87776fa1825dae029c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f5468727573746572494f2f687474702d7365727665722e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/5e282561f24fcf149c486366bd546698583d38da793e8a87776fa1825dae029c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f5468727573746572494f2f687474702d7365727665722e7376673f7374796c653d666c61742d737175617265)\] () \[[![Total Downloads](https://camo.githubusercontent.com/c3024a58af4db0ebdad2b908cd8226a5892f671613b86b45e10eef8490d371ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74687275737465722f687474702d7365727665722e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/c3024a58af4db0ebdad2b908cd8226a5892f671613b86b45e10eef8490d371ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74687275737465722f687474702d7365727665722e7376673f7374796c653d666c61742d737175617265)\] ()

\[[![Email](https://camo.githubusercontent.com/fc4998410b6b71d697bf556c37294970fedc130c081c82698cdb5ca22d70cade/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f656d61696c2d7465616d4074687275737465722e696f2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/fc4998410b6b71d697bf556c37294970fedc130c081c82698cdb5ca22d70cade/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f656d61696c2d7465616d4074687275737465722e696f2d626c75652e7376673f7374796c653d666c61742d737175617265)\] ()

The Thruster HttpServer Component.

Install
-------

[](#install)

Via Composer

```
$ composer require thruster/http-server
```

Usage
-----

[](#usage)

HTTP Server accepts Thruster Socket Server, `ServerApplicationInteface` implementing object and EventLoop

```
use GuzzleHttp\Psr7\Response;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Thruster\Component\EventLoop\EventLoop;
use Thruster\Component\Socket\Server;
use Thruster\Component\HttpServer\HttpServer;
use Thruster\Component\ServerApplication\SynchronousServerApplication;

$application = new class extends SynchronousServerApplication {
    /**
     * {@inheritDoc}
     */
    public function processRequestSynchronously(ServerRequestInterface $request) : ResponseInterface
    {
        $response = new Response(200);
        $response->getBody()->write('Hello World!');

        return $response;
    }

    public function preloadApplication()
    {
    }
};

$loop   = new EventLoop();
$socket = new Server($loop);

$httpServer = HttpServer::create($application)
    ->attachTo($socket)
    ->enableDebug();

$socket->listen(1337, '0.0.0.0');

$loop->run();
```

### Benchmark results

[](#benchmark-results)

```
Server Software:
Server Hostname:        127.0.0.1
Server Port:            1337

Document Path:          /
Document Length:        22 bytes

Concurrency Level:      10
Time taken for tests:   2.148 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      1340000 bytes
HTML transferred:       220000 bytes
Requests per second:    4655.03 [#/sec] (mean)
Time per request:       2.148 [ms] (mean)
Time per request:       0.215 [ms] (mean, across all concurrent requests)
Transfer rate:          609.15 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:     1    2   0.9      2      11
Waiting:        1    2   0.9      2      11
Total:          1    2   0.9      2      11

Percentage of the requests served within a certain time (ms)
  50%      2
  66%      2
  75%      2
  80%      2
  90%      3
  95%      3
  98%      5
  99%      7
 100%     11 (longest request)

```

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

License
-------

[](#license)

Please see [License File](LICENSE) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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 ~47 days

Total

4

Last Release

3636d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/770bae1f46ac2b4536db820b8642491c25e2e2fd44e761110269e4722679a80d?d=identicon)[aurimasniekis](/maintainers/aurimasniekis)

---

Tags

httpserverhttp serverthrusterHTTPServer

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[react/http

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

78126.4M414](/packages/react-http)[amphp/http-server

A non-blocking HTTP application server for PHP based on Amp.

1.3k4.5M81](/packages/amphp-http-server)[swow/swow

Coroutine-based multi-platform support engine with a focus on concurrent I/O

1.3k2.1M84](/packages/swow-swow)[psr/http-server-handler

Common interface for HTTP server-side request handler

175101.3M921](/packages/psr-http-server-handler)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[leocavalcante/request-callback

Swoole request callback for PSR compliant handlers.

261.2k1](/packages/leocavalcante-request-callback)

PHPackages © 2026

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