diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index 4f13d57930..679f37fd7f 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -109,7 +109,7 @@ methods: { connect() { this.pusher = new Pusher(this.app.key, { - wsHost: window.location.hostname, + wsHost: this.app.host === null ? window.location.hostname : this.app.host, wsPort: this.port, disableStats: true, authEndpoint: '/{{ request()->path() }}/auth', diff --git a/src/Apps/App.php b/src/Apps/App.php index dcb17843f4..b11023db0c 100644 --- a/src/Apps/App.php +++ b/src/Apps/App.php @@ -18,6 +18,9 @@ class App /** @var string|null */ public $name; + /** @var string|null */ + public $host; + /** @var bool */ public $clientMessagesEnabled = false; @@ -63,6 +66,13 @@ public function setName(string $appName) return $this; } + public function setHost(string $host) + { + $this->host = $host; + + return $this; + } + public function enableClientMessages(bool $enabled = true) { $this->clientMessagesEnabled = $enabled; diff --git a/src/Apps/ConfigAppProvider.php b/src/Apps/ConfigAppProvider.php index a0ded0f665..786c9e2026 100644 --- a/src/Apps/ConfigAppProvider.php +++ b/src/Apps/ConfigAppProvider.php @@ -67,6 +67,10 @@ protected function instanciate(?array $appAttributes): ?App $app->setName($appAttributes['name']); } + if (isset($appAttributes['host'])) { + $app->setHost($appAttributes['host']); + } + $app ->enableClientMessages($appAttributes['enable_client_messages']) ->enableStatistics($appAttributes['enable_statistics']);