@pitaj Making a deep testing to connect my app to nodebb websocket, I realize that I have an error. I run this command in wscat:
wscat -c ws://forum.example.com/socket.io
and this is the response:
error: Unexpected server response: 502
The nginx config is:
server {
listen 80;
server_name forum.example.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:4567;
proxy_redirect off;
# Socket.IO Support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
The nodeBB config.json:
{
"url": "http://forum.example.com",
"secret": "&//&%$$",
"database": "mongo",
"mongo": {
"host": "127.0.0.1",
"port": "27017",
"username": "nodebb",
"password": "MyPass",
"database": "nodebb",
"uri": ""
},
"port": "4567",
"socket.io": {
"origins": ["*:*"],
"transports": ["polling","websocket"]
}
}
Is correct the ws://forum.example.com/socket.io
address?
Is this the correct workaround to connect through ws to nodeBB?