added wss tools 2
This commit is contained in:
@@ -102,15 +102,27 @@ class WebsocketBroadcastService
|
||||
private function resolveHost(): string
|
||||
{
|
||||
$config = app(ConfigService::class);
|
||||
|
||||
$appUrl = trim($config->getString('app_url', ''));
|
||||
if ($appUrl !== '') {
|
||||
$host = parse_url($appUrl, PHP_URL_HOST);
|
||||
if (is_string($host) && $host !== '') {
|
||||
return $host;
|
||||
}
|
||||
}
|
||||
|
||||
if (! app()->runningInConsole() && request()) {
|
||||
$requestHost = trim((string) request()->getHost());
|
||||
if ($requestHost !== '') {
|
||||
return $requestHost;
|
||||
}
|
||||
}
|
||||
|
||||
$nameEn = trim((string) $config->getString('name_en', ''));
|
||||
if ($nameEn !== '') {
|
||||
return $nameEn;
|
||||
}
|
||||
|
||||
if (! app()->runningInConsole() && request()) {
|
||||
return trim((string) request()->getHost());
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user