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

Add optional server variable #14

Merged
merged 3 commits into from
Dec 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/views/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
10 changes: 10 additions & 0 deletions src/Apps/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class App
/** @var string|null */
public $name;

/** @var string|null */
public $host;

/** @var bool */
public $clientMessagesEnabled = false;

Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/Apps/ConfigAppProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down