sockets - 为什么我在 WebRTC 会议中收到 Websocket 错误?
问题描述
我正在尝试 AntMedia EE 试用版
我正在使用位于 https://ant.techrova.in/LiveApp/conference.html的 WebRTC 演示
(内置演示)
加入房间被禁用,我检查控制台
我收到这些错误
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>
=====================
请帮助解决此问题
解决方案
请启用以下模块:
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
推荐阅读
- google-bigquery - 如何 SELECT _TABLE_SUFFIX 等来区分数据
- excel - 为什么多级排序后会出现空行?
- python - For 循环没有正确地遍历数组
- python-3.x - 无法在 Azure 表上获取超过 1000 行的行内容
- javascript - 参数更改GET请求后角度重新获取数据
- optimization - 如何基于 R 中的点相交对栅格子集执行栅格计算(例如方面)
- angular - 在 Angular 4 中,如何将数据从一个子组件发送到同一个父组件的另一个子组件?
- h2o - H2O 异常:water.AutoBuffer.AutoBufferException
- python-3.x - 设置 python3 PYTHONHOME
- python - VS Code 中的 Conda 环境激活失败