Exemplo n.º 1
0
 /**
  * Handshake request listener
  *
  * Closes the connection on handshake from an origin that isn't allowed
  *
  * @param Connection $connection
  * @param string $path
  * @param string $origin
  * @param string $key
  * @param array $extensions
  */
 public function onHandshakeRequest(Connection $connection, $path, $origin, $key, $extensions)
 {
     if (!$this->isAllowed($origin)) {
         $connection->close(new InvalidOriginException('Origin not allowed'));
     }
 }