snapweb icon indicating copy to clipboard operation
snapweb copied to clipboard

Doesn't work when behind a HTTPS reverse proxy

Open djmattyg007 opened this issue 5 years ago • 1 comments

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.

djmattyg007 avatar Nov 14 '20 23:11 djmattyg007

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.

patagonaa avatar Nov 16 '20 23:11 patagonaa

Should be fixed since a while now

badaix avatar Mar 07 '24 15:03 badaix