We're trying to present the WebSocket-enabled interface from a remote device on our website.
I've configured the WebSocket tunnel in Apache, but I'm getting a "400 Proxy Error" in Firefox (in Chrome: "Websocket connection to ... failed"), and the WebSocket upgrade fails (the upgrade request never reaches the remote device). Firefox is using wss://, and the proxy is going to an insecure ws:// scheme on the remote host.
Apache proxy configuration is:
<Location /ws/>
ProxyPass http://10.1.2.3/
ProxyPassReverse /
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule (.*) ws://$1 [P]
</Location>
The Apache error log shows the proxy going to the right end-point, and gives an "OK" status:
[rewrite:trace1] mod_rewrite.c(483): [perdir /ws/] pass through proxy:http://10.1.2.3/socket.io/1/?t=1619199242068
[rewrite:trace1] mod_rewrite.c(483): [perdir /ws/] go-ahead with proxy request proxy:ws://proxy:http://10.1.2.3/socket.io/1/websocket/Ecr8KsStUznLLly3Av_f [OK]
How can I get more information on the cause of this failure, or how can I fix it?