Skip to content

garveen/fastcgi-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

garveen/fastcgi-react

Simply serve fastcgi with reactphp

composer require garveen/fastcgi-react
require 'vendor/autoload.php';

$loop = React\EventLoop\Factory::create();
$socket = new React\Socket\Server(9000, $loop);

$fastcgi = new Garveen\FastCgi\React($socket);

// see http://www.php-fig.org/psr/psr-7/
$fastcgi->onRequest = function (Psr\Http\Message\RequestInterface $request) {
    return new Garveen\FastCgi\Response(
        '200', // status code
        ['x-powered-by' => 'garveen/fastcgi-react'], // headers
        'Hello World!' // body
    );
};

$loop->run();

About

Simply serve fastcgi with reactphp

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages