mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
Allow specifying server host and port in share command
This commit is contained in:
@@ -45,7 +45,7 @@ class Client
|
|||||||
$sharedUrl = $this->prepareSharedUrl($sharedUrl);
|
$sharedUrl = $this->prepareSharedUrl($sharedUrl);
|
||||||
|
|
||||||
foreach ($subdomains as $subdomain) {
|
foreach ($subdomains as $subdomain) {
|
||||||
$this->connectToServer($sharedUrl, $subdomain, config('expose.auth_token'));
|
$this->connectToServer($sharedUrl, $subdomain, $this->configuration->auth());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use Symfony\Component\Console\Output\ConsoleOutput;
|
|||||||
|
|
||||||
class ShareCommand extends Command
|
class ShareCommand extends Command
|
||||||
{
|
{
|
||||||
protected $signature = 'share {host} {--subdomain=} {--auth=}';
|
protected $signature = 'share {host} {--subdomain=} {--auth=} {--server-host=} {--server-port=}';
|
||||||
|
|
||||||
protected $description = 'Share a local url with a remote expose server';
|
protected $description = 'Share a local url with a remote expose server';
|
||||||
|
|
||||||
@@ -27,11 +27,15 @@ class ShareCommand extends Command
|
|||||||
{
|
{
|
||||||
$this->configureConnectionLogger();
|
$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())
|
(new Factory())
|
||||||
->setLoop(app(LoopInterface::class))
|
->setLoop(app(LoopInterface::class))
|
||||||
->setHost(config('expose.host', 'localhost'))
|
->setHost($serverHost)
|
||||||
->setPort(config('expose.port', 8080))
|
->setPort($serverPort)
|
||||||
->setAuth($this->option('auth'))
|
->setAuth($auth)
|
||||||
->createClient()
|
->createClient()
|
||||||
->share($this->argument('host'), explode(',', $this->option('subdomain')))
|
->share($this->argument('host'), explode(',', $this->option('subdomain')))
|
||||||
->createHttpServer()
|
->createHttpServer()
|
||||||
|
|||||||
Reference in New Issue
Block a user