This commit is contained in:
Marcel Pociot committed 2020-04-24 16:10:38 +02:00
commit a3eb79b77a
19 files changed
+1873 -1562

No files matched your search

+8 -1
View File
@@ -39,7 +39,9 @@ class Client
protected function connectToServer(string $sharedUrl, $subdomain)
{
connect("ws://{$this->configuration->host()}:{$this->configuration->port()}/__expose_control__?authToken={$this->configuration->authToken()}", [], [
$token = config('expose.auth_token');
connect("ws://{$this->configuration->host()}:{$this->configuration->port()}/__expose_control__?authToken={$token}", [], [
'X-Expose-Control' => 'enabled',
], $this->loop)
->then(function (WebSocket $clientConnection) use ($sharedUrl, $subdomain) {
@@ -47,6 +49,11 @@ class Client
$connection->authenticate($sharedUrl, $subdomain);
$clientConnection->on('close', function() {
$this->logger->error('Connection to server closed.');
exit(1);
});
$connection->on('authenticationFailed', function ($data) {
$this->logger->error("Authentication failed. Please check your authentication token and try again.");
exit(1);