I am running a website on Apache. I have two apps that use web sockets, one is based on Node, which uses port 3000 and the other is based on Phoenix, which uses port 4000. Both apps also use a reverse proxy. For example, I have something like this:
<Location /node/>
ProxyPass http://127.0.0.1:3000/
ProxyPassReverse http://127.0.0.1:3000/
</Location>
<Location /phoenix/>
ProxyPass http://127.0.0.1:4000/
ProxyPassReverse http://127.0.0.1:4000/
</Location>
However, I am having problems getting the web sockets to work. I have something like this this set up for the Node app (outside the <Location> context):
RewriteCond %{QUERY_STRING} transport=polling [NC]
RewriteRule /(.*) http://127.0.0.1:3000/$1 [P]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /(.*) ws://127.0.0.1:3000/$1 [P]
I developed my Node app a few years ago and everything worked perfectly. However, I am currently developing the Phoenix app, and I don't know how to handle directing the sockets. Eventually, I plan on phasing out the Node app completely, but I need to keep it running for our users until the new app is developed. However, I still need the new app running at the same time on the website so I can develop it. It would be nice to get sockets working on both apps at the same time.