diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index fdfc191..dc24c62 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -130,11 +130,12 @@ const store = createStore({ } console.log('🔌 Initializing Daemon WebSocket connection to:', import.meta.env.VITE_DAEMON_SOCKET); try { - const daemonSocket = new WebSocket(import.meta.env.VITE_DAEMON_SOCKET); + const daemonSocket = new WebSocket(import.meta.env.VITE_DAEMON_SOCKET, 'yourpart-protocol'); daemonSocket.onopen = () => { console.log('✅ Daemon WebSocket connected successfully'); const payload = JSON.stringify({ + user_id: state.user.id, event: 'setUserId', data: { userId: state.user.id } }); diff --git a/yourpart-https.conf b/yourpart-https.conf index 6b37a86..941ab28 100644 --- a/yourpart-https.conf +++ b/yourpart-https.conf @@ -37,8 +37,9 @@ RewriteCond %{HTTP:Connection} upgrade [NC] RewriteRule ^/ws/(.*)$ "ws://localhost:4551/$1" [P,L] - # Blockiere alle anderen /ws/ Requests (nur WebSocket-Upgrade erlaubt) - ProxyPass "/ws/" "!" + # WebSocket-Proxy für Daemon-Verbindungen mit benutzerdefiniertem Protokoll + ProxyPass "/ws/" "ws://localhost:4551/" upgrade=websocket + ProxyPassReverse "/ws/" "ws://localhost:4551/" ErrorLog /var/log/apache2/yourpart.error.log CustomLog /var/log/apache2/yourpart.access.log combined