Push WesocketChanges
This commit is contained in:
@@ -19,14 +19,25 @@
|
|||||||
# Wichtig für Kamera-Zugriff
|
# Wichtig für Kamera-Zugriff
|
||||||
Header always set Permissions-Policy "camera=self, microphone=()"
|
Header always set Permissions-Policy "camera=self, microphone=()"
|
||||||
|
|
||||||
# Reverse Proxy zu Node.js
|
# WebSocket Support - MUSS vor dem generellen Proxy stehen
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteCond %{HTTP:Upgrade} websocket [NC]
|
||||||
|
RewriteCond %{HTTP:Connection} upgrade [NC]
|
||||||
|
RewriteRule ^/?(.*) "ws://localhost:3000/$1" [P,L]
|
||||||
|
|
||||||
|
# Socket.IO spezifische WebSocket-Routen
|
||||||
|
ProxyPass /socket.io/ ws://localhost:3000/socket.io/
|
||||||
|
ProxyPassReverse /socket.io/ ws://localhost:3000/socket.io/
|
||||||
|
|
||||||
|
# Standard HTTP/HTTPS Reverse Proxy zu Node.js
|
||||||
ProxyPreserveHost On
|
ProxyPreserveHost On
|
||||||
|
ProxyPass /socket.io/ !
|
||||||
ProxyPass / http://localhost:3000/
|
ProxyPass / http://localhost:3000/
|
||||||
ProxyPassReverse / http://localhost:3000/
|
ProxyPassReverse / http://localhost:3000/
|
||||||
|
|
||||||
# WebSocket Support für Live-Updates
|
# WebSocket Proxy-Einstellungen
|
||||||
ProxyPass /socket.io/ ws://localhost:3000/socket.io/
|
ProxyTimeout 3600
|
||||||
ProxyPassReverse /socket.io/ ws://localhost:3000/socket.io/
|
ProxyBadHeader Ignore
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
ErrorLog ${APACHE_LOG_DIR}/ninjaserver_ssl_error.log
|
ErrorLog ${APACHE_LOG_DIR}/ninjaserver_ssl_error.log
|
||||||
|
|||||||
45
websocket-setup-commands.sh
Executable file
45
websocket-setup-commands.sh
Executable file
@@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "🔧 Apache WebSocket Support Setup"
|
||||||
|
echo "================================="
|
||||||
|
|
||||||
|
# Kopiere die aktualisierte Apache-Konfiguration
|
||||||
|
echo "Kopiere Apache-Konfiguration..."
|
||||||
|
sudo cp /root/ninjaserver/apache-ssl-config.conf /etc/apache2/sites-available/ninjaserver-ssl.conf
|
||||||
|
echo "✅ Konfiguration kopiert"
|
||||||
|
|
||||||
|
# Apache Module aktivieren
|
||||||
|
echo "Aktiviere benötigte Apache-Module..."
|
||||||
|
sudo a2enmod proxy
|
||||||
|
sudo a2enmod proxy_http
|
||||||
|
sudo a2enmod proxy_wstunnel
|
||||||
|
sudo a2enmod rewrite
|
||||||
|
sudo a2enmod headers
|
||||||
|
sudo a2enmod ssl
|
||||||
|
|
||||||
|
echo "✅ Module aktiviert"
|
||||||
|
|
||||||
|
# SSL Site aktivieren (falls noch nicht geschehen)
|
||||||
|
echo "Aktiviere SSL-Site..."
|
||||||
|
sudo a2ensite ninjaserver-ssl
|
||||||
|
|
||||||
|
# Standard-Site deaktivieren (optional)
|
||||||
|
echo "Deaktiviere Standard-Site..."
|
||||||
|
sudo a2dissite 000-default
|
||||||
|
|
||||||
|
# Apache-Konfiguration testen
|
||||||
|
echo "Teste Apache-Konfiguration..."
|
||||||
|
sudo apache2ctl configtest
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "✅ Apache-Konfiguration ist gültig"
|
||||||
|
echo "Starte Apache neu..."
|
||||||
|
sudo systemctl restart apache2
|
||||||
|
echo "✅ Apache wurde neugestartet"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "🎉 WebSocket Support sollte jetzt funktionieren!"
|
||||||
|
echo "Teste die Verbindung mit: wss://ninja.reptilfpv.de/socket.io/"
|
||||||
|
else
|
||||||
|
echo "❌ Apache-Konfiguration hat Fehler - bitte überprüfen"
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user