mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
add docs
This commit is contained in:
@@ -203,6 +203,10 @@ class Client
|
||||
$this->logger->info($data->message);
|
||||
});
|
||||
|
||||
$connection->on('warning', function ($data) {
|
||||
$this->logger->warn($data->message);
|
||||
});
|
||||
|
||||
$connection->on('error', function ($data) {
|
||||
$this->logger->error($data->message);
|
||||
});
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Commands;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use App\Client\Factory;
|
||||
use React\EventLoop\LoopInterface;
|
||||
|
||||
@@ -33,6 +34,16 @@ class ShareCommand extends ServerAwareCommand
|
||||
$domain = $this->option('domain');
|
||||
}
|
||||
|
||||
if (! is_null($this->option('subdomain'))) {
|
||||
$subdomains = explode(',', $this->option('subdomain'));
|
||||
$this->info('Trying to use custom domain: '.$subdomains[0]);
|
||||
} else {
|
||||
$host = Str::beforeLast($this->argument('host'), '.');
|
||||
$host = Str::beforeLast($host, ':');
|
||||
$subdomains = [Str::slug($host)];
|
||||
$this->info('Trying to use custom domain: '.$subdomains[0].PHP_EOL);
|
||||
}
|
||||
|
||||
(new Factory())
|
||||
->setLoop(app(LoopInterface::class))
|
||||
->setHost($this->getServerHost())
|
||||
@@ -41,7 +52,7 @@ class ShareCommand extends ServerAwareCommand
|
||||
->createClient()
|
||||
->share(
|
||||
$this->argument('host'),
|
||||
explode(',', $this->option('subdomain')),
|
||||
$subdomains,
|
||||
$domain
|
||||
)
|
||||
->createHttpServer()
|
||||
|
||||
@@ -312,7 +312,7 @@ class ControlMessageController implements MessageComponentInterface
|
||||
*/
|
||||
if (! is_null($user) && $user['can_specify_subdomains'] === 0 && ! is_null($subdomain)) {
|
||||
$connection->send(json_encode([
|
||||
'event' => 'info',
|
||||
'event' => 'error',
|
||||
'data' => [
|
||||
'message' => config('expose.admin.messages.custom_subdomain_unauthorized').PHP_EOL,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user