A text, audio and video chat application built with webRTC and Ratchet (PHP WebSocket)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

25 lines
623 B

<?php
/**
* Description of server
*
* @author Amir <amirsanni@gmail.com>
* @date 23-Dec-2016
*/
require '../vendor/autoload.php';
use Amir\Comm;
//set an array of origins allowed to connect to this server
$allowed_origins = ['localhost', '127.0.0.1', '1410inc.xyz', 'www.1410inc.xyz'];
// Run the server application through the WebSocket protocol on port 8080
$app = new Ratchet\App('1410inc.xyz', 8080, '0.0.0.0');//App(hostname, port, 'whoCanConnectIP', '')
//create socket routes
//route(uri, classInstance, arrOfAllowedOrigins)
$app->route('/comm', new Comm, $allowed_origins);
//run websocket
$app->run();