Apache conditional websockets

If you have Apache >= 2.4 and enabled proxy_wstunnel, then this example may help to show how to redirect websockets connections to the right place. (Note that there are easier ways if you want to redirect all traffic to the websocket location. This example is for if you want to have the normal HTTP side-by-side with the websockets.)

[...]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /(.*) ws://localhost:1234/$1 [P,L]
[...]

no responses for Apache conditional websockets

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.