mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
Pass client version to server
This commit is contained in:
@@ -77,9 +77,11 @@ class Client
|
||||
$deferred = new Deferred();
|
||||
$promise = $deferred->promise();
|
||||
|
||||
$exposeVersion = config('app.version');
|
||||
|
||||
$wsProtocol = $this->configuration->port() === 443 ? 'wss' : 'ws';
|
||||
|
||||
connect($wsProtocol."://{$this->configuration->host()}:{$this->configuration->port()}/expose/control?authToken={$authToken}", [], [
|
||||
connect($wsProtocol."://{$this->configuration->host()}:{$this->configuration->port()}/expose/control?authToken={$authToken}&version={$exposeVersion}", [], [
|
||||
'X-Expose-Control' => 'enabled',
|
||||
], $this->loop)
|
||||
->then(function (WebSocket $clientConnection) use ($sharedUrl, $subdomain, $serverHost, $deferred, $authToken) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Server\Connections;
|
||||
|
||||
use App\Http\QueryParameters;
|
||||
use Evenement\EventEmitterTrait;
|
||||
use Ratchet\ConnectionInterface;
|
||||
|
||||
@@ -16,6 +17,7 @@ class ControlConnection
|
||||
public $authToken;
|
||||
public $subdomain;
|
||||
public $client_id;
|
||||
public $client_version;
|
||||
public $proxies = [];
|
||||
protected $shared_at;
|
||||
|
||||
@@ -28,6 +30,7 @@ class ControlConnection
|
||||
$this->authToken = $authToken;
|
||||
$this->serverHost = $serverHost;
|
||||
$this->shared_at = now()->toDateTimeString();
|
||||
$this->client_version = QueryParameters::create($socket->httpRequest)->get('version');
|
||||
}
|
||||
|
||||
public function setMaximumConnectionLength(int $maximumConnectionLength)
|
||||
@@ -65,6 +68,7 @@ class ControlConnection
|
||||
'host' => $this->host,
|
||||
'server_host' => $this->serverHost,
|
||||
'client_id' => $this->client_id,
|
||||
'client_version' => $this->client_version,
|
||||
'auth_token' => $this->authToken,
|
||||
'subdomain' => $this->subdomain,
|
||||
'shared_at' => $this->shared_at,
|
||||
|
||||
@@ -32,7 +32,7 @@ return [
|
||||
| if available.
|
||||
|
|
||||
*/
|
||||
'server_endpoint' => 'https://beyondco.de/api/expose/servers',
|
||||
'server_endpoint' => 'https://expose.beyondco.de/api/expose/servers',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user