expressif / http
http implementation with expressif streams
0.0.1-rc3
2015-01-28 21:06 UTC
Requires
- ext-http: >=2.1.0
- expressif/socket: 0.0.5
This package is not auto-updated.
Last update: 2024-11-09 17:30:03 UTC
README
Contains http bindings between pecl_http and libevent for creating a fast web server.
Requirements
This library use expressif/stream and http module :
- PHP 5.6+
- libevent
- pecl_http
If you are on windows (for dev & test purpose) you can dirrectly install pre-built libraries.
NOTE : if you plan to use this library on a multi-core server, you should consider expressif/cluster
usage
<?php require 'vendor/autoload.php'; use Expressif\Http\Server; $endpoint = '127.0.0.1:1337'; echo "Serving HTTP at http://$endpoint\n"; $http = new Server('tcp://' . $endpoint); $http->on('request', function($req, $res) { $res->writeHead(200, ['Content-Type' => 'text/plain']); $res->end('Hello world'); });