reactphp

Solutions on MaxInterview for reactphp by the best coders in the world

showing results for - "reactphp"
Tiffany
20 Jul 2019
1$loop = React\EventLoop\Factory::create();
2
3$server = new React\Http\Server($loop, function (Psr\Http\Message\ServerRequestInterface $request) {
4    return new React\Http\Message\Response(
5        200,
6        array(
7            'Content-Type' => 'text/plain'
8        ),
9        "Hello World!\n"
10    );
11});
12
13$socket = new React\Socket\Server(8080, $loop);
14$server->listen($socket);
15
16echo "Server running at http://127.0.0.1:8080\n";
17
18$loop->run();
similar questions
queries leading to this page
reactphp