Jump to content
  • 0

WebSocket not connected after adding SSL


Tahmid Khandokar
 Share

Question

Hello! There,

I've installed AMS enterprise edition (pay as you go package) and then I've added SSL with my Domain which is pointed to a EC2 Instance. And it works great. I can login to AMS with a account and also I've added the license.  
Now the problem is when I just try to test LiveApp/WebRTCEE using this URL, [https://golaiv-server.tech/LiveApp] OR [https://golaiv-server.tech/WebRTCAppEE], it shows the WebSocket not connected error. But when I used AMS using localhost it worked fine. For this error I couldn't use WSS to my application. I've added the browser console image in this post. Please help me. 

 698016007_Screenshot2022-11-15122858.png.ec8ad22051882565ebf38c1968ab199d.png

Error:

1940182327_Screenshot2022-11-15122841.png.c0b8865738e50e7da59c70a5ec038632.png

Thank you.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

FYI please,
@Tahmid Khandokarresolves the issue by removing the Nginx server.

Below configuration can be used to run the Ant Media Server behind the Nginx reverse proxy:
 

events {
    worker_connections 1048576;
    multi_accept on;
    use epoll;
}

http{
server { 
            listen 443 ssl;
            ssl_certificate /etc/letsencrypt/live/your-domain-name/fullchain.pem;
            ssl_certificate_key /etc/letsencrypt/live/your-domain-name/privkey.pem;
            server_name your-domain-name;

            location / {
                proxy_pass http://your--ams-server-ip:5080/;
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";

            }
        }
}

 

  • Like 1
Link to comment
Share on other sites

  • 0

Something to note here is that Websockets are a different Protocol that may not automatically be passed via a Proxy server without adding the Web Socket support.  This goes for Apache and NGINX (which with NGINX is the Upgrade option.)

Something I found to fix an issue like this for our On-Premise server - we use a Sophos XG firewall, and you have to change from a standard Proxy connection to one with Path Specific Routing then enable Websocket Passthrough.

Link for enabling that on such a device is here below.

https://community.sophos.com/sophos-xg-firewall/f/discussions/132910/pass-a-websocket-connection-through-waf

  • Like 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...