First my website was loading over http
and websocket connection was made over ws
like this:
conn = new WebSocket('ws://myDomain:8080');
and everything was working fine and connection was made successfully
then I tried Cloudflare’s SSL and now my website loads over https
an so I changed the ws
to wss
like this:
conn = new WebSocket('wss://myDomain:8080');
now i get this error:
WebSocket connection to 'wss://myDomain:8080/' failed: Error in
connection establishment: net::ERR_CONNECTION_TIMED_OUT
what is causing this? do i have to do do any configurations for nginx?
here is my nginx config:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /srv/mydir;
server_name myDomain.com;
location / {
index index.html;
}
}
I would appreciate any help