mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
wip
This commit is contained in:
43
app/Server/Connections/ControlConnection.php
Normal file
43
app/Server/Connections/ControlConnection.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Server\Connections;
|
||||
|
||||
use Evenement\EventEmitterTrait;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use Illuminate\Support\Str;
|
||||
use Nyholm\Psr7\Factory\Psr17Factory;
|
||||
use Ratchet\Client\WebSocket;
|
||||
use Ratchet\ConnectionInterface;
|
||||
use Ratchet\RFC6455\Messaging\Frame;
|
||||
use Ratchet\WebSocket\WsConnection;
|
||||
use React\Stream\Util;
|
||||
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
|
||||
|
||||
class ControlConnection
|
||||
{
|
||||
use EventEmitterTrait;
|
||||
|
||||
/** @var ConnectionInterface */
|
||||
public $socket;
|
||||
public $host;
|
||||
public $subdomain;
|
||||
public $client_id;
|
||||
public $proxies = [];
|
||||
|
||||
public function __construct(ConnectionInterface $socket, string $host, string $subdomain, string $clientId)
|
||||
{
|
||||
$this->socket = $socket;
|
||||
$this->host = $host;
|
||||
$this->subdomain = $subdomain;
|
||||
$this->client_id = $clientId;
|
||||
}
|
||||
|
||||
public function registerProxy($requestId)
|
||||
{
|
||||
$this->socket->send(json_encode([
|
||||
'event' => 'createProxy',
|
||||
'request_id' => $requestId,
|
||||
'client_id' => $this->client_id,
|
||||
]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user