Let browser construct URL string for us
Likely a lot safer for corner cases than us trying to figure this out ourselves.
This commit is contained in:
parent
06f14a5cd3
commit
074fa1a40f
11
app/ui.js
11
app/ui.js
|
@ -1033,16 +1033,17 @@ const UI = {
|
||||||
|
|
||||||
let url;
|
let url;
|
||||||
|
|
||||||
url = UI.getSetting('encrypt') ? 'wss' : 'ws';
|
url = new URL("https://" + host);
|
||||||
|
|
||||||
url += '://' + host;
|
url.protocol = UI.getSetting('encrypt') ? 'wss:' : 'ws:';
|
||||||
if (port) {
|
if (port) {
|
||||||
url += ':' + port;
|
url.port = port;
|
||||||
}
|
}
|
||||||
url += '/' + path;
|
url.pathname = '/' + path;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
UI.rfb = new RFB(document.getElementById('noVNC_container'), url,
|
UI.rfb = new RFB(document.getElementById('noVNC_container'),
|
||||||
|
url.href,
|
||||||
{ shared: UI.getSetting('shared'),
|
{ shared: UI.getSetting('shared'),
|
||||||
repeaterID: UI.getSetting('repeaterID'),
|
repeaterID: UI.getSetting('repeaterID'),
|
||||||
credentials: { password: password } });
|
credentials: { password: password } });
|
||||||
|
|
Loading…
Reference in New Issue