This repository was archived by the owner on Feb 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +16
-1
lines changed Expand file tree Collapse file tree 4 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 13
13
[
14
14
'id ' => env ('PUSHER_APP_ID ' ),
15
15
'name ' => env ('APP_NAME ' ),
16
+ 'server ' => null ,
16
17
'key ' => env ('PUSHER_APP_KEY ' ),
17
18
'secret ' => env ('PUSHER_APP_SECRET ' ),
18
19
'enable_client_messages ' => false ,
Original file line number Diff line number Diff line change 109
109
methods: {
110
110
connect () {
111
111
this .pusher = new Pusher (this .app .key , {
112
- wsHost: window .location .hostname ,
112
+ wsHost: this . app . server . length === 0 ? window .location .hostname : this . app . server ,
113
113
wsPort: this .port ,
114
114
disableStats: true ,
115
115
authEndpoint: ' /{{ request ()-> path () } } /auth' ,
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ class App
18
18
/** @var string|null */
19
19
public $ name ;
20
20
21
+ /** @var string|null */
22
+ public $ server ;
23
+
21
24
/** @var bool */
22
25
public $ clientMessagesEnabled = false ;
23
26
@@ -63,6 +66,13 @@ public function setName(string $appName)
63
66
return $ this ;
64
67
}
65
68
69
+ public function setServer (string $ server )
70
+ {
71
+ $ this ->server = $ server ;
72
+
73
+ return $ this ;
74
+ }
75
+
66
76
public function enableClientMessages (bool $ enabled = true )
67
77
{
68
78
$ this ->clientMessagesEnabled = $ enabled ;
Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ protected function instanciate(?array $appAttributes): ?App
67
67
$ app ->setName ($ appAttributes ['name ' ]);
68
68
}
69
69
70
+ if (isset ($ appAttributes ['server ' ])) {
71
+ $ app ->setServer ($ appAttributes ['server ' ]);
72
+ }
73
+
70
74
$ app
71
75
->enableClientMessages ($ appAttributes ['enable_client_messages ' ])
72
76
->enableStatistics ($ appAttributes ['enable_statistics ' ]);
You can’t perform that action at this time.
0 commit comments