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 1313 [
1414 'id ' => env ('PUSHER_APP_ID ' ),
1515 'name ' => env ('APP_NAME ' ),
16+ 'server ' => null ,
1617 'key ' => env ('PUSHER_APP_KEY ' ),
1718 'secret ' => env ('PUSHER_APP_SECRET ' ),
1819 'enable_client_messages ' => false ,
Original file line number Diff line number Diff line change 109109 methods: {
110110 connect () {
111111 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 ,
113113 wsPort: this .port ,
114114 disableStats: true ,
115115 authEndpoint: ' /{{ request ()-> path () } } /auth' ,
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ class App
1818 /** @var string|null */
1919 public $ name ;
2020
21+ /** @var string|null */
22+ public $ server ;
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 setServer (string $ server )
70+ {
71+ $ this ->server = $ server ;
72+
73+ return $ this ;
74+ }
75+
6676 public function enableClientMessages (bool $ enabled = true )
6777 {
6878 $ this ->clientMessagesEnabled = $ enabled ;
Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ protected function instanciate(?array $appAttributes): ?App
6767 $ app ->setName ($ appAttributes ['name ' ]);
6868 }
6969
70+ if (isset ($ appAttributes ['server ' ])) {
71+ $ app ->setServer ($ appAttributes ['server ' ]);
72+ }
73+
7074 $ app
7175 ->enableClientMessages ($ appAttributes ['enable_client_messages ' ])
7276 ->enableStatistics ($ appAttributes ['enable_statistics ' ]);
You can’t perform that action at this time.
0 commit comments