mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 21:45:55 +00:00
wip
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user