Skip to content
No description or website provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
src
tests/Server
.dockerignore
.gitignore
.travis.yml
Dockerfile
README.md
composer.json
composer.lock
docker-compose.yaml
jmeter.jmx
php.ini
phpunit.xml.dist

README.md

Native PHP HTTP Server - EXPERIMENTAL DRAFT!!!

Based on not yet released php async functionality. Package will be split to separate repositories later.

Features:

  1. HTTP/1.x Server
  2. Stream request reader
  3. Single process mode
  4. Cluster mode (build on top of IPC and fork)
  5. Graceful shutdown
  6. Symfony integration

To do:

  • Rewrite server class

  • GET, HEAD, OPTIONS, CONNECT

  • POST, PATCH, PUT (Stream body)

  • Echo server (for testing purposes)

  • Switch to ServerRequestInterface

  • Read, Handle and Write timeouts

  • application/x-www-form-urlencoded

  • multipart/form-data

  • Encodings, mb_* functions

  • SSL

  • static files

  • SIGINT, SIGTERM, SIGKILL

  • Middlewares

  • Intercept memory error

  • Memory metrics

  • Compression

  • Response content-length calculation

  • Use async/await syntax

  • Own PSR7 implementation

  • Integrate server with DI container

  • Symfony command

  • Symfony kernel.terminate listener

  • Split repository

  • 408 - Request timeout

  • 411 - Length required

  • 413 - Request size limit (headers, body)

  • 426 - Upgrade required

  • 505 - Version not supported

  • Tests

  • Profiling & Optimization (Reader, Worker, Handler, Writer)

  • Keep-alive support, HTTP/2

  • file watcher

Run testing echo server:

composer install --ignore-platform-reqs
docker-compose run --rm echo php /app/examples/echo.php
curl http://127.0.0.1:3000/

Symfony:

cd examples/symfony
composer install --ignore-platform-reqs
docker-compose run --rm -T echo php /app/examples/symfony/bin/console http:serve --address 0.0.0.0
curl http://127.0.0.1:3000/
You can’t perform that action at this time.