diff --git a/README.md b/README.md index 9bad8ad4..f4b70d9f 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,12 @@ This is an HTTP server which responds with `Hello World` to every request. $loop = React\EventLoop\Factory::create(); $socket = new React\Socket\Server($loop); -$http = new React\Http\Server($socket); -$http->on('request', function ($request, $response) { +$calllback = function (Request $request, Response $response) { $response->writeHead(200, array('Content-Type' => 'text/plain')); $response->end("Hello World!\n"); -}); +}; + +$http = new React\Http\Server($socket, $callback); $socket->listen(1337); $loop->run();