diff --git a/resources/web/js/src/connection.ts b/resources/web/js/src/connection.ts index 342e0e3..5b41e7e 100644 --- a/resources/web/js/src/connection.ts +++ b/resources/web/js/src/connection.ts @@ -753,12 +753,22 @@ function getDefaultUri(isRelay: Boolean = false): string { const host = localStorage.getItem("custom-rendezvous-server"); return getrUriFromRs(host || HOST, isRelay); } +/* +function isHttps() { + return window.location.protocol === "https:" +} + +function domain(uri: string) { + return uri.indexOf(":") > 0 ? uri.split(":")[0] : uri +}*/ function getrUriFromRs( uri: string, isRelay: Boolean = false, roffset: number = 0 ): string { + //v2 + //if (isHttps()) return "wss://" + domain(uri) + "/ws/" + (isRelay ? "relay" : "id"); if (uri.indexOf(":") > 0) { const tmp = uri.split(":"); const port = parseInt(tmp[1]);