mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 21:45:55 +00:00
Apply fixes from StyleCI
This commit is contained in:
committed by
StyleCI Bot
parent
0e33bc7d99
commit
83676deddb
@@ -3,10 +3,9 @@
|
||||
namespace App\Client;
|
||||
|
||||
use App\Client\Http\HttpClient;
|
||||
use Ratchet\Client\WebSocket;
|
||||
use Ratchet\ConnectionInterface;
|
||||
use React\EventLoop\LoopInterface;
|
||||
use function Ratchet\Client\connect;
|
||||
use Ratchet\Client\WebSocket;
|
||||
use React\EventLoop\LoopInterface;
|
||||
|
||||
class ProxyManager
|
||||
{
|
||||
@@ -24,14 +23,14 @@ class ProxyManager
|
||||
|
||||
public function createProxy(string $clientId, $connectionData)
|
||||
{
|
||||
$protocol = $this->configuration->port() === 443 ? "wss" : "ws";
|
||||
$protocol = $this->configuration->port() === 443 ? 'wss' : 'ws';
|
||||
|
||||
connect($protocol."://{$this->configuration->host()}:{$this->configuration->port()}/expose/control", [], [
|
||||
'X-Expose-Control' => 'enabled',
|
||||
], $this->loop)
|
||||
->then(function (WebSocket $proxyConnection) use ($clientId, $connectionData) {
|
||||
$proxyConnection->on('message', function ($message) use ($proxyConnection, $connectionData) {
|
||||
$this->performRequest($proxyConnection, $connectionData->request_id, (string)$message);
|
||||
$this->performRequest($proxyConnection, $connectionData->request_id, (string) $message);
|
||||
});
|
||||
|
||||
$proxyConnection->send(json_encode([
|
||||
@@ -46,6 +45,6 @@ class ProxyManager
|
||||
|
||||
protected function performRequest(WebSocket $proxyConnection, $requestId, string $requestData)
|
||||
{
|
||||
app(HttpClient::class)->performRequest((string)$requestData, $proxyConnection, $requestId);
|
||||
app(HttpClient::class)->performRequest((string) $requestData, $proxyConnection, $requestId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user