Почему я получаю ошибку Websocket в конференции WebRT C? - PullRequest
0 голосов
/ 30 мая 2020

Я пробую пробную версию AntMedia EE

Я использую демонстрацию WebRT C, расположенную в https://ant.techrova.in/LiveApp/conference.html

(встроенная демонстрация)

Комната для присоединения отключена, и я проверяю консоль

enter image description here

Я получаю эту ошибку

Подключение WebSocket к ' wss: //ant.techrova.in/LiveApp/websocket 'не удалось: ошибка во время рукопожатия WebSocket: неожиданный код ответа: 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>

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

Пожалуйста, помогите решить эту проблему

1 Ответ

2 голосов
/ 30 мая 2020

Включите следующие модули:

a2enmod proxy proxy_http proxy_wstunnel

Добавьте следующие строки в свой файл conf.

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

После этого перезапустите службы apache2, как показано ниже:

systemctl restart apache2
...