This commit is contained in:
Marcel Pociot
2020-04-17 16:13:15 +02:00
parent 2778d5a489
commit 60727ac86e
5 changed files with 127 additions and 33 deletions

View File

@@ -3,7 +3,6 @@
namespace App\Commands;
use App\Server\Factory;
use Illuminate\Console\Scheduling\Schedule;
use LaravelZero\Framework\Commands\Command;
use React\EventLoop\LoopInterface;

View File

@@ -9,16 +9,20 @@ use React\EventLoop\LoopInterface;
class ShareCommand extends Command
{
protected $signature = 'share {host} {--subdomain=}';
protected $signature = 'share {host} {--subdomain=} {--auth=}';
protected $description = 'Share a local url with a remote shaft server';
public function handle()
{
if ($this->option('auth')) {
$GLOBALS['expose.auth'] = $this->option('auth');
}
(new Factory())
->setLoop(app(LoopInterface::class))
->setHost('beyond.sh')
->setPort(8080)
// ->setHost('beyond.sh') // TODO: Read from (local/global) config file
// ->setPort(8080) // TODO: Read from (local/global) config file
->createClient($this->argument('host'), explode(',', $this->option('subdomain')))
->createHttpServer()
->run();