snapweb
snapweb copied to clipboard
Doesn't work when behind a HTTPS reverse proxy
I'm attempting to reverse proxy snapweb with nginx so that you can access the web interface with HTTPS, and not have to remember a port number. At the moment this doesn't seem to work, because the JS code always attempts an insecure websocket connection which the browser blocks.
I believe this is the offending line of code:
https://github.com/badaix/snapweb/blob/master/page/snapcontrol.ts#L176
From a glance I assume all you'd need to do is check whether the current page is HTTPS or not and then supply wss:// rather than ws://.
I'm happy to submit this as a pull request myself, but I don't currently have a good way of actually testing the change. If you're happy for me to do so without testing, I can gladly do so.
This is basically fixed by #20 (not fully yet, because it would introduce breaking changes). See https://github.com/badaix/snapweb/pull/22#issuecomment-728357605 for an explanation.
Should be fixed since a while now