Make it possible to customise the port the dashboard connects to (#124)
* Make it possible to customise the port the dashboard connects to. * Fixed so both wsPort and wssPort are changed. * Changed env port name and added path * Fixed typo in wsPath * Moved port into dashboard section in config * Changed env name to LARAVEL_WEBSOCKETS_PORT
This commit is contained in:
parent
fa86844ea5
commit
8e422cbc5b
|
|
@ -4,6 +4,13 @@ use BeyondCode\LaravelWebSockets\Dashboard\Http\Middleware\Authorize;
|
|||
|
||||
return [
|
||||
|
||||
/*
|
||||
* Set a custom dashboard configuration
|
||||
*/
|
||||
'dashboard' => [
|
||||
'port' => env('LARAVEL_WEBSOCKETS_PORT', 6001),
|
||||
],
|
||||
|
||||
/*
|
||||
* This package comes with multi tenancy out of the box. Here you can
|
||||
* configure the different apps that can use the webSockets server.
|
||||
|
|
@ -20,6 +27,7 @@ return [
|
|||
'name' => env('APP_NAME'),
|
||||
'key' => env('PUSHER_APP_KEY'),
|
||||
'secret' => env('PUSHER_APP_SECRET'),
|
||||
'path' => env('PUSHER_APP_PATH'),
|
||||
'capacity' => null,
|
||||
'enable_client_messages' => false,
|
||||
'enable_statistics' => true,
|
||||
|
|
|
|||
|
|
@ -95,8 +95,8 @@
|
|||
connected: false,
|
||||
chart: null,
|
||||
pusher: null,
|
||||
port: 6001,
|
||||
app: null,
|
||||
port: {{ $port }},
|
||||
apps: {!! json_encode($apps) !!},
|
||||
form: {
|
||||
channel: null,
|
||||
|
|
@ -114,8 +114,9 @@
|
|||
connect() {
|
||||
this.pusher = new Pusher(this.app.key, {
|
||||
wsHost: this.app.host === null ? window.location.hostname : this.app.host,
|
||||
wsPort: this.port,
|
||||
wssPort: this.port,
|
||||
wsPort: this.port === null ? 6001 : this.port,
|
||||
wssPort: this.port === null ? 6001 : this.port,
|
||||
wsPath: this.app.path === null ? '' : this.app.path,
|
||||
disableStats: true,
|
||||
authEndpoint: '/{{ request()->path() }}/auth',
|
||||
auth: {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class ShowDashboard
|
|||
{
|
||||
return view('websockets::dashboard', [
|
||||
'apps' => $apps->all(),
|
||||
'port' => config('websockets.dashboard.port', 6001),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue