mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-15 14:35:55 +00:00
wip
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Server\Messages;
|
||||
use App\Server\Connections\ConnectionManager;
|
||||
use Illuminate\Support\Str;
|
||||
use Ratchet\ConnectionInterface;
|
||||
use React\EventLoop\LoopInterface;
|
||||
use stdClass;
|
||||
|
||||
class ControlMessage implements Message
|
||||
@@ -45,6 +46,13 @@ class ControlMessage implements Message
|
||||
'subdomain' => $connectionInfo->subdomain,
|
||||
'client_id' => $connectionInfo->client_id
|
||||
]));
|
||||
|
||||
$loop = app(LoopInterface::class);
|
||||
$timer = $loop->addPeriodicTimer(5, function () use ($connection) {
|
||||
$connection->send(json_encode([
|
||||
'event' => 'ping'
|
||||
]));
|
||||
});
|
||||
}
|
||||
|
||||
protected function registerProxy(ConnectionInterface $connection, $data)
|
||||
|
||||
@@ -69,10 +69,10 @@ class TunnelMessage implements Message
|
||||
|
||||
private function copyDataToClient(Connection $clientConnection)
|
||||
{
|
||||
$data = $clientConnection->rewriteHostInformation($this->connectionManager->host(), $this->connectionManager->port(), $this->connection->buffer);
|
||||
|
||||
$requestId = uniqid();
|
||||
|
||||
$data = $clientConnection->rewriteHostInformation($this->connectionManager->host(), $this->connectionManager->port(), $requestId, $this->connection->buffer);
|
||||
|
||||
// Ask client to create a new proxy
|
||||
$clientConnection->socket->send(json_encode([
|
||||
'event' => 'createProxy',
|
||||
|
||||
Reference in New Issue
Block a user