Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit f03acd1

Browse files
authored
Merge pull request #14 from LKaemmerling/master
Add optional server variable
2 parents 76e091d + 5245ba8 commit f03acd1

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

resources/views/dashboard.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
methods: {
114114
connect() {
115115
this.pusher = new Pusher(this.app.key, {
116-
wsHost: window.location.hostname,
116+
wsHost: this.app.host === null ? window.location.hostname : this.app.host,
117117
wsPort: this.port,
118118
wssPort: this.port,
119119
disableStats: true,

src/Apps/App.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ class App
1818
/** @var string|null */
1919
public $name;
2020

21+
/** @var string|null */
22+
public $host;
23+
2124
/** @var bool */
2225
public $clientMessagesEnabled = false;
2326

@@ -63,6 +66,13 @@ public function setName(string $appName)
6366
return $this;
6467
}
6568

69+
public function setHost(string $host)
70+
{
71+
$this->host = $host;
72+
73+
return $this;
74+
}
75+
6676
public function enableClientMessages(bool $enabled = true)
6777
{
6878
$this->clientMessagesEnabled = $enabled;

src/Apps/ConfigAppProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ protected function instanciate(?array $appAttributes): ?App
6767
$app->setName($appAttributes['name']);
6868
}
6969

70+
if (isset($appAttributes['host'])) {
71+
$app->setHost($appAttributes['host']);
72+
}
73+
7074
$app
7175
->enableClientMessages($appAttributes['enable_client_messages'])
7276
->enableStatistics($appAttributes['enable_statistics']);

0 commit comments

Comments
 (0)