Anpassenden der Websocket Konfiguration
parent
08c58699ba
commit
75ffc68c78
|
|
@ -0,0 +1,30 @@
|
||||||
|
|
||||||
|
SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS
|
||||||
|
|
||||||
|
Commands marked with * may be preceded by a number, _N.
|
||||||
|
Notes in parentheses indicate the behavior if _N is given.
|
||||||
|
A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K.
|
||||||
|
|
||||||
|
h H Display this help.
|
||||||
|
q :q Q :Q ZZ Exit.
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
MMOOVVIINNGG
|
||||||
|
|
||||||
|
e ^E j ^N CR * Forward one line (or _N lines).
|
||||||
|
y ^Y k ^K ^P * Backward one line (or _N lines).
|
||||||
|
f ^F ^V SPACE * Forward one window (or _N lines).
|
||||||
|
b ^B ESC-v * Backward one window (or _N lines).
|
||||||
|
z * Forward one window (and set window to _N).
|
||||||
|
w * Backward one window (and set window to _N).
|
||||||
|
ESC-SPACE * Forward one window, but don't stop at end-of-file.
|
||||||
|
d ^D * Forward one half-window (and set half-window to _N).
|
||||||
|
u ^U * Backward one half-window (and set half-window to _N).
|
||||||
|
ESC-) RightArrow * Right one half screen width (or _N positions).
|
||||||
|
ESC-( LeftArrow * Left one half screen width (or _N positions).
|
||||||
|
ESC-} ^RightArrow Right to last column displayed.
|
||||||
|
ESC-{ ^LeftArrow Left to first column.
|
||||||
|
F Forward forever; like "tail -f".
|
||||||
|
ESC-F Like F but stop when search pattern is found.
|
||||||
|
r ^R ^L Repaint screen.
|
||||||
|
R
|
||||||
|
|
@ -52,7 +52,7 @@ return [
|
||||||
'secret' => env('REVERB_APP_SECRET'),
|
'secret' => env('REVERB_APP_SECRET'),
|
||||||
'app_id' => env('REVERB_APP_ID'),
|
'app_id' => env('REVERB_APP_ID'),
|
||||||
'options' => [
|
'options' => [
|
||||||
'host' => env('REVERB_HOST'), // öffentlich (gleicht VITE_REVERB_HOST)
|
'host' => env('REVERB_HOST'),
|
||||||
'port' => (int) env('REVERB_PORT', 443),
|
'port' => (int) env('REVERB_PORT', 443),
|
||||||
'scheme' => env('REVERB_SCHEME', 'https'),
|
'scheme' => env('REVERB_SCHEME', 'https'),
|
||||||
'path' => env('REVERB_PATH', '/ws'),
|
'path' => env('REVERB_PATH', '/ws'),
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,4 @@ window.axios = axios;
|
||||||
|
|
||||||
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||||
|
|
||||||
import './webserver/websocket.js'
|
import './webserver/websocket.js';
|
||||||
|
|
|
||||||
|
|
@ -1,46 +1,18 @@
|
||||||
// resources/js/plugins/connector.js
|
function fromWindow() {
|
||||||
function readMetaConfig() {
|
const isHttps = typeof window !== 'undefined' && window.location.protocol === 'https:'
|
||||||
const el = (typeof document !== 'undefined')
|
|
||||||
? document.querySelector('meta[name="reverb"]')
|
|
||||||
: null;
|
|
||||||
if (!el) return null;
|
|
||||||
|
|
||||||
const { host, port, scheme, path, key } = el.dataset; // data-*
|
|
||||||
return {
|
return {
|
||||||
host: host || null,
|
host: (typeof window !== 'undefined' && window.location.hostname) || '127.0.0.1',
|
||||||
port: port ? Number(port) : null,
|
port: isHttps ? 443 : 80,
|
||||||
scheme: scheme || null,
|
scheme: isHttps ? 'https' : 'http',
|
||||||
path: path || null,
|
path: '/ws',
|
||||||
key: key || null,
|
key: import.meta?.env?.VITE_REVERB_APP_KEY || ''
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
const meta = readMetaConfig()
|
||||||
|
const fallback = readViteEnv()
|
||||||
|
const base = meta ?? fallback ?? fromWindow()
|
||||||
|
|
||||||
function readViteEnv() {
|
// harte Korrektur: NIEMALS 8080 nach außen geben
|
||||||
const env = (typeof import.meta !== 'undefined' && import.meta.env) ? import.meta.env : {};
|
if (Number(base.port) === 8080 && (base.scheme || 'https').startsWith('http')) {
|
||||||
return {
|
base.port = (base.scheme === 'https') ? 443 : 80
|
||||||
host: env.VITE_REVERB_HOST || env.APP_HOST || '127.0.0.1',
|
|
||||||
port: env.VITE_REVERB_PORT ? Number(env.VITE_REVERB_PORT) : 443,
|
|
||||||
scheme: (env.VITE_REVERB_SCHEME || 'https').toLowerCase(),
|
|
||||||
path: env.VITE_REVERB_PATH || '/ws',
|
|
||||||
key: env.VITE_REVERB_APP_KEY || 'mailwolt-yhp47tbt1aebhr1fgvgj',
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalize(cfg) {
|
|
||||||
const c = { ...cfg };
|
|
||||||
if (!c.path || typeof c.path !== 'string') c.path = '/ws';
|
|
||||||
if (!c.path.startsWith('/')) c.path = '/' + c.path;
|
|
||||||
c.wsScheme = (c.scheme === 'http' ? 'ws' : 'wss');
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
const fromMeta = readMetaConfig();
|
|
||||||
const base = fromMeta ?? readViteEnv();
|
|
||||||
|
|
||||||
export const wsConfig = normalize({
|
|
||||||
host: base.host || '127.0.0.1',
|
|
||||||
port: base.port || 443,
|
|
||||||
scheme: base.scheme || 'https',
|
|
||||||
path: base.path || '/ws',
|
|
||||||
key: base.key || 'mailwolt-yhp47tbt1aebhr1fgvgj',
|
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
import Echo from 'laravel-echo'
|
import Echo from 'laravel-echo'
|
||||||
import Pusher from 'pusher-js'
|
import Pusher from 'pusher-js'
|
||||||
import {wsConfig} from "./connector.js";
|
import { wsConfig } from './connector.js'
|
||||||
|
|
||||||
window.Pusher = Pusher
|
window.Pusher = Pusher
|
||||||
|
|
||||||
const host = wsConfig.host || window.location.hostname
|
const host = wsConfig.host || window.location.hostname
|
||||||
const port = Number(wsConfig.port) || 443 // <- post -> port
|
const port = Number(wsConfig.port) || 443 // <— port!
|
||||||
const scheme = (wsConfig.scheme || 'https').toLowerCase()
|
const scheme = (wsConfig.scheme || 'https').toLowerCase()
|
||||||
const path = wsConfig.path || '/ws'
|
const path = wsConfig.path || '/ws'
|
||||||
const tls = scheme === 'https'
|
const tls = scheme === 'https' // <— boolean
|
||||||
const key = wsConfig.key
|
const key = wsConfig.key
|
||||||
|
|
||||||
window.Echo = new Echo({
|
window.Echo = new Echo({
|
||||||
|
|
@ -18,6 +18,6 @@ window.Echo = new Echo({
|
||||||
wsPort: port,
|
wsPort: port,
|
||||||
wssPort: port,
|
wssPort: port,
|
||||||
forceTLS: tls,
|
forceTLS: tls,
|
||||||
enabledTransports: ['ws', 'wss'],
|
enabledTransports: ['ws','wss'],
|
||||||
wsPath: path,
|
wsPath: path,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,11 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="reverb"
|
<meta name="reverb"
|
||||||
data-host="{{ config('reverb.servers.reverb.host') }}"
|
data-host="{{ request()->getHost() }}"
|
||||||
data-port="{{ config('reverb.servers.reverb.port') }}"
|
data-port="{{ request()->isSecure() ? 443 : 80 }}"
|
||||||
data-scheme="{{ config('reverb.servers.reverb.scheme') }}"
|
data-scheme="{{ request()->isSecure() ? 'https' : 'http' }}"
|
||||||
data-path="{{ config('reverb.servers.reverb.path') }}"
|
data-path="{{ config('reverb.servers.reverb.path') }}"
|
||||||
data-key="{{ config('reverb.servers.reverb.key') }}">
|
data-key="{{ env('REVERB_APP_KEY') }}">
|
||||||
<title>@yield('title', config('app.name'))</title>
|
<title>@yield('title', config('app.name'))</title>
|
||||||
@vite(['resources/css/app.css','resources/js/app.js'])
|
@vite(['resources/css/app.css','resources/js/app.js'])
|
||||||
@livewireStyles
|
@livewireStyles
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue