我有以下的apache2配置,适用于chrome和internet explorer:
我有以下的apache2配置,适用于chrome和internet explorer:
Listen 80
IncludeOptional conf.d/*.conf
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
<VirtualHost *:80>
#ProxyRequests On
ProxyPass / http://IP:8585/
ProxyPassReverse / http://IP:8585/
ProxyPass /call ws://IP:8585/call
ProxyPassReverse /call ws://IP:8585/call
ProxyPass /call/ ws://IP:8585/call/
ProxyPassReverse /call/ ws://IP:8585/call/
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://localhost:8585%{REQUEST_URI} [P]
</VirtualHost>
问题在于它不能通过火狐浏览器工作。
我发现唯一的区别是火狐浏览器发送了 Connection: keep-alive, Upgrade
而不仅仅是 Upgrade
。
我需要改变我的Rewriterule吗?
^Upgrade$
中的^
。请参见此处 https://dev59.com/qXzaa4cB1Zd3GeqPV-U-#34371105 - user1274820