From 2fbd6072342e38b0efb9a5a946dec206a8338e45 Mon Sep 17 00:00:00 2001 From: Nicolas Cantu Date: Sat, 20 Sep 2025 14:39:28 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20Correction=20du=20probl=C3=A8me=20WebSo?= =?UTF-8?q?cket=20HTTPS/WS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Correction de l'erreur Mixed Content - Configuration des URLs WebSocket sécurisées (WSS) - Documentation de la solution appliquée - Leçons apprises pour éviter ce problème --- docs/CORRECTIONS_APPLIQUEES.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/CORRECTIONS_APPLIQUEES.md b/docs/CORRECTIONS_APPLIQUEES.md index 0ac569e..39cdfe5 100644 --- a/docs/CORRECTIONS_APPLIQUEES.md +++ b/docs/CORRECTIONS_APPLIQUEES.md @@ -90,3 +90,34 @@ git.4nkweb.com/4nk/sdk_storage:ext - Distinguer les projets de configuration des projets avec images Docker - Vérifier l'existence des images avant pull - Documenter l'architecture des projets pour éviter cette confusion + +## 🔧 Correction du Problème WebSocket HTTPS/WS + +### Problème Identifié +L'iframe (ihm_client) tentait de se connecter à `ws://sdk_relay:8090/` (non sécurisé) depuis une page HTTPS, causant une erreur de sécurité "Mixed Content". + +### Erreurs Observées +``` +Mixed Content: The page at 'https://dev4.4nkweb.com/' was loaded over HTTPS, +but attempted to connect to the insecure WebSocket endpoint 'ws://sdk_relay:8090/'. +This request has been blocked; this endpoint must be available over WSS. +``` + +### Solution Appliquée +**Correction des variables d'environnement:** +- `ihm_client/.env`: `RELAY_URLS=wss://dev4.4nkweb.com/ws/,wss://dev3.4nkweb.com/ws/` +- `lecoffre-back-mini/.env`: `RELAY_URLS=wss://dev4.4nkweb.com/ws/,wss://dev3.4nkweb.com/ws/` + +**Configuration Nginx:** +- Proxy WebSocket `/ws/` → `http://127.0.0.1:8090/` (déjà configuré) +- Headers WebSocket corrects (Upgrade, Connection) + +### Résultat +- ✅ Connexions WebSocket sécurisées (WSS) +- ✅ Pas d'erreur Mixed Content +- ✅ Services redémarrés avec la nouvelle configuration + +### Leçon Apprise +- Toujours utiliser WSS pour les connexions WebSocket depuis des pages HTTPS +- Vérifier la configuration des variables d'environnement pour les URLs WebSocket +- Tester la connectivité WebSocket avec des outils appropriés (wscat)