Proxying Websockets and QLC
Posted: Wed Feb 17, 2021 5:56 pm
Heya, So this is an interesting one. I am trying to allow my students to control a lab I have setup in the shop. To do this I have created a website on a virtually hosted machine that has a VPN back here to the shop and a running version of QLC. ( hidden behind a local BasicAuth ).
Using Apache httpd and config is thus:
So doing some testing and getting some interesting results:
Using Apache httpd and config is thus:
Code: Select all
RewriteEngine on
RewriteCond ${HTTP:Upgrade} websocket [NC]
RewriteCond ${HTTP:Connection} upgrade [NC]
RewriteRule .* "wss:/192.168.1.15:9999/$1" [P,L]
ProxyPass /qlcplusWS ws://192.168.1.15:9999/qlcplusWS retry=4
ProxyPassReverse /qlcplusWS ws://192.168.1.15:9999/qlcplusWS retry=4
# everything else
ProxyPass / http://192.168.1.15:9999/
ProxyPassReverse / http://192.168.1.15:9999/
- at first startup of httpd... first client to connect wins and can run things.
- local clients using the local address work just fine .. they can initiate control and it's reflected both places
- second and subsequent remote client connects, no error but can't do anything except see the page. No change reflected.
- subsequent local clients work just fine and do the Right thing(tm)