Merge pull request #14 from LKaemmerling/master
Add optional server variable
This commit is contained in:
commit
f03acd10a4
|
|
@ -113,7 +113,7 @@
|
||||||
methods: {
|
methods: {
|
||||||
connect() {
|
connect() {
|
||||||
this.pusher = new Pusher(this.app.key, {
|
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,
|
wsPort: this.port,
|
||||||
wssPort: this.port,
|
wssPort: this.port,
|
||||||
disableStats: true,
|
disableStats: true,
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,9 @@ class App
|
||||||
/** @var string|null */
|
/** @var string|null */
|
||||||
public $name;
|
public $name;
|
||||||
|
|
||||||
|
/** @var string|null */
|
||||||
|
public $host;
|
||||||
|
|
||||||
/** @var bool */
|
/** @var bool */
|
||||||
public $clientMessagesEnabled = false;
|
public $clientMessagesEnabled = false;
|
||||||
|
|
||||||
|
|
@ -63,6 +66,13 @@ class App
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setHost(string $host)
|
||||||
|
{
|
||||||
|
$this->host = $host;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function enableClientMessages(bool $enabled = true)
|
public function enableClientMessages(bool $enabled = true)
|
||||||
{
|
{
|
||||||
$this->clientMessagesEnabled = $enabled;
|
$this->clientMessagesEnabled = $enabled;
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,10 @@ class ConfigAppProvider implements AppProvider
|
||||||
$app->setName($appAttributes['name']);
|
$app->setName($appAttributes['name']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($appAttributes['host'])) {
|
||||||
|
$app->setHost($appAttributes['host']);
|
||||||
|
}
|
||||||
|
|
||||||
$app
|
$app
|
||||||
->enableClientMessages($appAttributes['enable_client_messages'])
|
->enableClientMessages($appAttributes['enable_client_messages'])
|
||||||
->enableStatistics($appAttributes['enable_statistics']);
|
->enableStatistics($appAttributes['enable_statistics']);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue