[webmgmt] Use javascript secure scheme detection instead of server detection
Please see:
https://gitlab.labs.nic.cz/knot/knot-resolver/blob/master/modules/http/static/kresd.js#L335
This wont work with latest browsers when we are using reverse proxy (with auth) like this:
(client) -> https://company.com/mgmt (reverse-proxy) -> http://resolver:8453
result is: ws://...
which gets blocked because it is not safe to use on https
Better should be something like this, which get evaluated entirely by browser:
var wsStats = ('https:' == document.location.protocol ? 'wss://' : 'ws://') + location.host + '/stats';