<!DOCTYPE html>
<html>
<head></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 TypE="text/javascript" SRC="https://asciinema.org/a/18487.js" id="asciicast-18487" async></script></body>
</html>
|