From cf14306c2b3f82a81f8d56669a71633b4d4b5fce Mon Sep 17 00:00:00 2001 From: marvin-borner@live.com Date: Mon, 16 Apr 2018 21:09:05 +0200 Subject: Main merge to user management system - files are now at /main/public/ --- .../php/vendor/cboden/ratchet/src/Ratchet/App.php | 145 --------------------- 1 file changed, 145 deletions(-) delete mode 100755 assets/php/vendor/cboden/ratchet/src/Ratchet/App.php (limited to 'assets/php/vendor/cboden/ratchet/src/Ratchet/App.php') diff --git a/assets/php/vendor/cboden/ratchet/src/Ratchet/App.php b/assets/php/vendor/cboden/ratchet/src/Ratchet/App.php deleted file mode 100755 index f378534..0000000 --- a/assets/php/vendor/cboden/ratchet/src/Ratchet/App.php +++ /dev/null @@ -1,145 +0,0 @@ -httpHost = $httpHost; - $this->port = $port; - - $socket = new Reactor($address . ':' . $port, $loop); - - $this->routes = new RouteCollection; - $this->_server = new IoServer(new HttpServer(new Router(new UrlMatcher($this->routes, new RequestContext))), $socket, $loop); - - $policy = new FlashPolicy; - $policy->addAllowedAccess($httpHost, 80); - $policy->addAllowedAccess($httpHost, $port); - - if (80 == $port) { - $flashUri = '0.0.0.0:843'; - } else { - $flashUri = 8843; - } - $flashSock = new Reactor($flashUri, $loop); - $this->flashServer = new IoServer($policy, $flashSock); - } - - /** - * Add an endpoint/application to the server - * @param string $path The URI the client will connect to - * @param ComponentInterface $controller Your application to server for the route. If not specified, assumed to be for a WebSocket - * @param array $allowedOrigins An array of hosts allowed to connect (same host by default), ['*'] for any - * @param string $httpHost Override the $httpHost variable provided in the __construct - * @return ComponentInterface|WsServer - */ - public function route($path, ComponentInterface $controller, array $allowedOrigins = array(), $httpHost = null) { - if ($controller instanceof HttpServerInterface || $controller instanceof WsServer) { - $decorated = $controller; - } elseif ($controller instanceof WampServerInterface) { - $decorated = new WsServer(new WampServer($controller)); - $decorated->enableKeepAlive($this->_server->loop); - } elseif ($controller instanceof MessageComponentInterface) { - $decorated = new WsServer($controller); - $decorated->enableKeepAlive($this->_server->loop); - } else { - $decorated = $controller; - } - - if ($httpHost === null) { - $httpHost = $this->httpHost; - } - - $allowedOrigins = array_values($allowedOrigins); - if (0 === count($allowedOrigins)) { - $allowedOrigins[] = $httpHost; - } - if ('*' !== $allowedOrigins[0]) { - $decorated = new OriginCheck($decorated, $allowedOrigins); - } - - //allow origins in flash policy server - if(empty($this->flashServer) === false) { - foreach($allowedOrigins as $allowedOrgin) { - $this->flashServer->app->addAllowedAccess($allowedOrgin, $this->port); - } - } - - $this->routes->add('rr-' . ++$this->_routeCounter, new Route($path, array('_controller' => $decorated), array('Origin' => $this->httpHost), array(), $httpHost, array(), array('GET'))); - - return $decorated; - } - - /** - * Run the server by entering the event loop - */ - public function run() { - $this->_server->run(); - } -} -- cgit v1.2.3