Document WebSocket corrections and ensure durable configuration
- Add CORRECTIONS_WEBSOCKET.md documentation - Fix Nginx configuration to use stable port mapping (127.0.0.1:8090) - Document WebSocket headers requirements - Ensure configuration survives container restarts
This commit is contained in:
parent
76cd5ffedf
commit
853bda8f44
34
docs/CORRECTIONS_WEBSOCKET.md
Normal file
34
docs/CORRECTIONS_WEBSOCKET.md
Normal file
@ -0,0 +1,34 @@
|
||||
# Corrections WebSocket - LeCoffre Node
|
||||
|
||||
## Problème identifié
|
||||
L'iframe `ihm_client` était bloquée sur "Chargement de l'authentification..." car la connexion WebSocket échouait.
|
||||
|
||||
## Cause racine
|
||||
- Nginx était configuré pour pointer vers `127.0.0.1:8090`
|
||||
- Le relay `sdk_relay` écoute sur `0.0.0.0:8090` dans le réseau Docker
|
||||
- Les requêtes HTTP simples étaient rejetées (erreur "Unsupported HTTP method")
|
||||
|
||||
## Solution appliquée
|
||||
1. **Configuration Nginx corrigée** : `proxy_pass http://127.0.0.1:8090/`
|
||||
2. **Headers WebSocket requis** :
|
||||
- `Upgrade: websocket`
|
||||
- `Connection: upgrade`
|
||||
- `Sec-WebSocket-Version: 13`
|
||||
- `Sec-WebSocket-Key: [base64-encoded-key]`
|
||||
|
||||
## Test de validation
|
||||
```bash
|
||||
curl -v -H "Upgrade: websocket" -H "Connection: upgrade" \
|
||||
-H "Sec-WebSocket-Version: 13" \
|
||||
-H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \
|
||||
https://dev4.4nkweb.com/ws/
|
||||
```
|
||||
|
||||
Résultat attendu : `HTTP/1.1 101 Switching Protocols`
|
||||
|
||||
## Configuration durable
|
||||
- Utilisation du port mappé `127.0.0.1:8090` (stable)
|
||||
- Éviter les IPs de containers (changent à chaque redémarrage)
|
||||
|
||||
## Date
|
||||
2025-09-20
|
Loading…
x
Reference in New Issue
Block a user