PHP Classes

File: bin/react.php

Recommend this page to a friend!
  Classes of Ahmad Mustapha  >  PHP Application Server  >  bin/react.php  >  Download  
File: bin/react.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Application Server
Run application with different types of Web server
Author: By
Last change:
Date: 2 months ago
Size: 454 bytes
 

Contents

Class file image Download
<?php

use PHPServer\ServerInfo;
use
PHPServer\Terminal;
use
React\Http\HttpServer;
use
React\Socket\SocketServer;

require
'vendor/autoload.php';

$arguments = Terminal::performServerChecks();

/**@var ServerInfo $serverInfo * */
$serverInfo = $arguments['info'];

$socket = new SocketServer("{$serverInfo->getHost()}:{$serverInfo->getPort()}");
$http = new HttpServer($serverInfo->getRequestCallback());

echo
"Server started";

$http->listen($socket);

For more information send a message to info at phpclasses dot org.