Verbesserung: Anpassung der WebSocket-Verbindung und Erweiterung der Protokollausgaben
Änderungen: - Der Daemon WebSocket-URL wurde von 'wss' auf 'ws' geändert, um die Verbindung zu optimieren. - Der WebSocket wird nun ohne spezifisches Protokoll initialisiert, um Tests zu erleichtern. - Zusätzliche Protokollausgaben wurden hinzugefügt, um Browserinformationen bei Verbindungsfehlern zu dokumentieren. Diese Anpassungen verbessern die Fehlerdiagnose und die Flexibilität der WebSocket-Verbindung.
This commit is contained in:
@@ -127,13 +127,13 @@ const store = createStore({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const daemonUrl = import.meta.env.VITE_DAEMON_SOCKET || 'wss://www.your-part.de:4551';
|
const daemonUrl = import.meta.env.VITE_DAEMON_SOCKET || 'ws://www.your-part.de:4551';
|
||||||
console.log('🔌 Initializing Daemon WebSocket connection to:', daemonUrl);
|
console.log('🔌 Initializing Daemon WebSocket connection to:', daemonUrl);
|
||||||
|
|
||||||
const connectDaemonSocket = () => {
|
const connectDaemonSocket = () => {
|
||||||
try {
|
try {
|
||||||
const daemonSocket = new WebSocket(daemonUrl, 'yourpart-protocol');
|
const daemonSocket = new WebSocket(daemonUrl);
|
||||||
console.log('🔌 Protocol: yourpart-protocol');
|
console.log('🔌 Protocol: none (testing without subprotocol)');
|
||||||
|
|
||||||
daemonSocket.onopen = () => {
|
daemonSocket.onopen = () => {
|
||||||
console.log('✅ Daemon WebSocket connected successfully');
|
console.log('✅ Daemon WebSocket connected successfully');
|
||||||
@@ -166,6 +166,11 @@ const store = createStore({
|
|||||||
url: daemonSocket.url,
|
url: daemonSocket.url,
|
||||||
protocol: daemonSocket.protocol
|
protocol: daemonSocket.protocol
|
||||||
});
|
});
|
||||||
|
console.error('❌ Browser info:', {
|
||||||
|
userAgent: navigator.userAgent,
|
||||||
|
location: window.location.href,
|
||||||
|
isSecure: window.location.protocol === 'https:'
|
||||||
|
});
|
||||||
retryConnection(connectDaemonSocket);
|
retryConnection(connectDaemonSocket);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user