3

I have the following apache2 configuration that is working for chrome and 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>

The problem is it does not work through firefox.

The only difference I have seen is that firefox sends Connection: keep-alive, Upgrade instead of simply Upgrade.

Do I need to change my Rewriterule ?

Menelaos
  • 23,508
  • 18
  • 90
  • 155

1 Answers1

1

Yes, you will need to add a condition to your rewrite rules. The below configuration will work as it checks for Connection values of Upgrade or keep-alive, Upgrade:

RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC,OR]
RewriteCond %{HTTP:CONNECTION} ^keep-alive,\ Upgrade$ [NC]
RewriteRule .* ws://localhost:8585%{REQUEST_URI} [P]
Jon Ruddell
  • 6,244
  • 1
  • 22
  • 40