Make server configurable when sharing files. Fix react/http compatibility issues

This commit is contained in:
Marcel Pociot
2021-05-19 11:35:27 +02:00
parent 60af8bce19
commit 44dca53687
4 changed files with 11 additions and 6 deletions

View File

@@ -10,7 +10,7 @@ use Symfony\Component\Console\Output\ConsoleOutput;
class ShareFilesCommand extends Command
{
protected $signature = 'share-files {folder=.} {--name=} {--subdomain=} {--auth=}';
protected $signature = 'share-files {folder=.} {--name=} {--subdomain=} {--auth=} {--server-host=} {--server-port=}';
protected $description = 'Share a local folder with a remote expose server';
@@ -31,11 +31,15 @@ class ShareFilesCommand extends Command
$this->configureConnectionLogger();
$serverHost = $this->option('server-host') ?? config('expose.host', 'localhost');
$serverPort = $this->option('server-port') ?? config('expose.port', 8080);
$auth = $this->option('auth') ?? config('expose.auth_token', '');
(new Factory())
->setLoop(app(LoopInterface::class))
->setHost(config('expose.host', 'localhost'))
->setPort(config('expose.port', 8080))
->setAuth($this->option('auth'))
->setHost($serverHost)
->setPort($serverPort)
->setAuth($auth)
->createClient()
->shareFolder(
$this->argument('folder'),