From 424f20bd90cebdaebf56251e1456a9166571cf30 Mon Sep 17 00:00:00 2001 From: Marcel Pociot Date: Mon, 4 May 2020 17:00:48 +0200 Subject: [PATCH] wip --- app/Client/Client.php | 9 +++++---- app/Client/Factory.php | 8 +------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/Client/Client.php b/app/Client/Client.php index 6af4e88..722a16b 100644 --- a/app/Client/Client.php +++ b/app/Client/Client.php @@ -43,8 +43,6 @@ class Client public function share(string $sharedUrl, array $subdomains = []) { - $this->logger->info("Sharing http://{$sharedUrl}"); - $sharedUrl = $this->prepareSharedUrl($sharedUrl); foreach ($subdomains as $subdomain) { @@ -115,7 +113,7 @@ class Client }); }); - $connection->on('authenticated', function ($data) use ($deferred) { + $connection->on('authenticated', function ($data) use ($deferred, $sharedUrl) { $httpProtocol = $this->configuration->port() === 443 ? "https" : "http"; $host = $this->configuration->host(); @@ -124,7 +122,10 @@ class Client } $this->logger->info($data->message); - $this->logger->info("Connected to {$httpProtocol}://{$data->subdomain}.{$host}"); + $this->logger->info("Local-URL:\t\t{$sharedUrl}"); + $this->logger->info("Dashboard-URL:\t\thttp://127.0.0.1:".config()->get('expose.dashboard_port')); + $this->logger->info("Expose-URL:\t\t{$httpProtocol}://{$data->subdomain}.{$host}"); + $this->logger->line(''); static::$subdomains[] = "{$httpProtocol}://{$data->subdomain}.{$host}"; diff --git a/app/Client/Factory.php b/app/Client/Factory.php index abd9454..18341de 100644 --- a/app/Client/Factory.php +++ b/app/Client/Factory.php @@ -143,13 +143,7 @@ class Factory { $dashboardPort = $this->detectNextFreeDashboardPort(); - $this->loop->futureTick(function () use ($dashboardPort) { - $dashboardUrl = "http://127.0.0.1:{$dashboardPort}/"; - - echo("Started Dashboard on port {$dashboardPort}" . PHP_EOL); - - echo('You can visit the dashboard at: ' . $dashboardUrl . PHP_EOL); - }); + config()->set('expose.dashboard_port', $dashboardPort); $this->app = new App('127.0.0.1', $dashboardPort, '0.0.0.0', $this->loop);