mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
web: fix websocket uri when page is loaded via file://
This commit is contained in:
parent
2e1805f4ac
commit
0c62ce4cf0
1 changed files with 10 additions and 5 deletions
|
@ -309,12 +309,17 @@ function wsUrl(endpoint)
|
|||
var l = window.location;
|
||||
var url = '';
|
||||
|
||||
if (l.protocol === 'https:')
|
||||
url += 'wss://';
|
||||
else
|
||||
url += 'ws://';
|
||||
if (l.protocol == 'file:') {
|
||||
url += 'ws://localhost';
|
||||
}
|
||||
else {
|
||||
if (l.protocol === 'https:')
|
||||
url += 'wss://';
|
||||
else
|
||||
url += 'ws://';
|
||||
|
||||
url += l.hostname;
|
||||
url += l.hostname;
|
||||
}
|
||||
|
||||
if ((l.port) && (l.port != 80) && (l.port != 443))
|
||||
url += ':'+ l.port;
|
||||
|
|
Loading…
Add table
Reference in a new issue