PHP Classes

File: server.php

Recommend this page to a friend!
  Classes of Istvan Dobrentei   PHP Server Monitor Script   server.php   Download  
File: server.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Server Monitor Script
Check if a server is working well using Websockets
Author: By
Last change:
Date: 5 years ago
Size: 419 bytes
 

Contents

Class file image Download
<?php
require __DIR__ . '/vendor/autoload.php';

use
Ratchet\Server\IoServer;
use
Ratchet\Http\HttpServer;
use
Ratchet\WebSocket\WsServer;
use
Noodlehaus\Config;
use
Distvan\App;

$configname = dirname(__FILE__) . '/config.ini';
$config = Config::load($configname);
$app = new App($config);

$server = IoServer::factory(new HttpServer(new WsServer($app)), $app->getPort());
$app->setLoop($server->loop);
$server->run();