mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-01 03:52:25 +00:00
server/js: also allow running on localhost
This commit is contained in:
parent
e5c5767298
commit
e4e83a648b
1 changed files with 9 additions and 1 deletions
|
@ -137,7 +137,15 @@ function websocketServerConnect() {
|
|||
}
|
||||
peer_id = getOurId();
|
||||
setStatus("Connecting to server");
|
||||
ws_conn = new WebSocket('wss://' + window.location.hostname + ':8443');
|
||||
loc = null;
|
||||
if (window.location.protocol.startsWith ("file")) {
|
||||
loc = "127.0.0.1";
|
||||
} else if (window.location.protocol.startsWith ("http")) {
|
||||
loc = window.location.hostname;
|
||||
} else {
|
||||
throw new Error ("Don't know how to connect to the signalling server with uri" + window.location);
|
||||
}
|
||||
ws_conn = new WebSocket('wss://' + loc + ':8443');
|
||||
/* When connected, immediately register with the server */
|
||||
ws_conn.addEventListener('open', (event) => {
|
||||
document.getElementById("peer-id").textContent = peer_id;
|
||||
|
|
Loading…
Reference in a new issue