mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
wip
This commit is contained in:
@@ -41,7 +41,9 @@ class Client
|
||||
{
|
||||
$token = config('expose.auth_token');
|
||||
|
||||
connect("ws://{$this->configuration->host()}:{$this->configuration->port()}/__expose_control__?authToken={$token}", [], [
|
||||
$protocol = $this->configuration->port() === 443 ? "wss" : "ws";
|
||||
|
||||
connect($protocol."://{$this->configuration->host()}:{$this->configuration->port()}/__expose_control__?authToken={$token}", [], [
|
||||
'X-Expose-Control' => 'enabled',
|
||||
], $this->loop)
|
||||
->then(function (WebSocket $clientConnection) use ($sharedUrl, $subdomain) {
|
||||
@@ -65,8 +67,10 @@ class Client
|
||||
static::$subdomains[] = "$data->subdomain.{$this->configuration->host()}:{$this->configuration->port()}";
|
||||
});
|
||||
|
||||
}, function ($e) {
|
||||
echo "Could not connect: {$e->getMessage()}\n";
|
||||
}, function (\Exception $e) {
|
||||
$this->logger->error("Could not connect to the server.");
|
||||
$this->logger->error($e->getMessage());
|
||||
exit(1);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user