<!DOCTYPE html><html><head> <body><pre><code class="php"><?php
require 'vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
$socket = new React\Socket\Server($loop);
$http = new React\Http\Server($socket, $loop);
$http->on('request', function ($request, $response) {
$response->writeHead(200, array('Content-Type' => 'text/plain'));
$response->end("Hello World\n");
});
$socket->listen(1337);
$loop->run();
</code></pre> <script async id=asciicast-18487 src=https://asciinema.org/a/18487.js></script>
|