This commit is contained in:
Marcel Pociot
2020-05-04 17:00:48 +02:00
parent 1199811809
commit 424f20bd90
2 changed files with 6 additions and 11 deletions

View File

@@ -43,8 +43,6 @@ class Client
public function share(string $sharedUrl, array $subdomains = []) public function share(string $sharedUrl, array $subdomains = [])
{ {
$this->logger->info("Sharing http://{$sharedUrl}");
$sharedUrl = $this->prepareSharedUrl($sharedUrl); $sharedUrl = $this->prepareSharedUrl($sharedUrl);
foreach ($subdomains as $subdomain) { 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"; $httpProtocol = $this->configuration->port() === 443 ? "https" : "http";
$host = $this->configuration->host(); $host = $this->configuration->host();
@@ -124,7 +122,10 @@ class Client
} }
$this->logger->info($data->message); $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}"; static::$subdomains[] = "{$httpProtocol}://{$data->subdomain}.{$host}";

View File

@@ -143,13 +143,7 @@ class Factory
{ {
$dashboardPort = $this->detectNextFreeDashboardPort(); $dashboardPort = $this->detectNextFreeDashboardPort();
$this->loop->futureTick(function () use ($dashboardPort) { config()->set('expose.dashboard_port', $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);
});
$this->app = new App('127.0.0.1', $dashboardPort, '0.0.0.0', $this->loop); $this->app = new App('127.0.0.1', $dashboardPort, '0.0.0.0', $this->loop);