【发布时间】:2019-06-21 16:37:29
【问题描述】:
我正在开发 WebSockets 的 apache 代理,连接在 Chrome 和 Safari Mobile 上运行良好,但 Firefox 返回 200 Ok 状态并断开连接。
有问题的服务器是运行 Apache 的 Centos 7 服务器,websocket 由 NodeJS 提供。
<VirtualHost *:443>
ServerAdmin webmaster@example.com
ServerName alpha.example.com
ServerAlias www.alpha.example.com
DocumentRoot public_html/
ErrorLog logs/error.log
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
SSLProxyEngine On
Include cert.pem
SSLCertificateKeyFile privkey.pem
SSLCertificateChainFile chain.pem
ProxyRequests Off
RewriteEngine On
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://localhost:8080%{REQUEST_URI} [P]
ProxyPass /ws http://127.0.0.1:8080
ProxyPassReverse /ws http://127.0.0.1:8080
</VirtualHost>
Chrome 连接到服务器,我可以双向发送事件。 Firefox 尝试连接,但随即以 200 Ok 状态关闭,但记录 Firefox can’t establish a connection to the server at wss://alpha.example.com/. Firefox 但可以加载代理请求,如 https://alpha.example.com/ws
【问题讨论】:
标签: apache firefox websocket proxypass