为什么我在 WebRTC 会议中收到 Websocket 错误?

Why am I getting Websocket Error in WebRTC Conference?

我正在试用 AntMedia EE 试用版

我正在使用位于 https://ant.techrova.in/LiveApp/conference.html

(内置演示)

加入房间已禁用,我查看控制台

我收到这些错误

WebSocket connection to 'wss://ant.techrova.in/LiveApp/websocket' failed: Error during WebSocket handshake: Unexpected response code: 404

不知道如何解决?

这是我的 apache 代理配置

对于 http

<VirtualHost *:80>
        ServerName ant.techrova.in
        ProxyPreserveHost On

        ProxyPass / http://127.0.0.1:5080/
        ProxyPassReverse / http://127.0.0.1:5080/

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

RewriteEngine on
RewriteCond %{SERVER_NAME} =ant.techrova.in
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]


</VirtualHost>

对于 https

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerName ant.techrova.in
        ProxyPreserveHost On

        ProxyPass / http://127.0.0.1:5080/
        ProxyPassReverse / http://127.0.0.1:5080/

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined



SSLCertificateFile /etc/letsencrypt/live/ant.techrova.in/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/ant.techrova.in/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

====================

请帮忙解决这个问题

请启用以下模块:

a2enmod proxy proxy_http proxy_wstunnel

在您的 conf 文件中添加以下行。

RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*)           ws://localhost:5080/ [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*)           http://localhost:5080/ [P,L]
ProxyPass / http://localhost:5080/
ProxyPassReverse / http://localhost:5080/

之后重启 apache2 服务如下:

systemctl restart apache2