up ws js
This commit is contained in:
10
resources/web/js/src/connection.ts
vendored
10
resources/web/js/src/connection.ts
vendored
@@ -753,12 +753,22 @@ function getDefaultUri(isRelay: Boolean = false): string {
|
|||||||
const host = localStorage.getItem("custom-rendezvous-server");
|
const host = localStorage.getItem("custom-rendezvous-server");
|
||||||
return getrUriFromRs(host || HOST, isRelay);
|
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(
|
function getrUriFromRs(
|
||||||
uri: string,
|
uri: string,
|
||||||
isRelay: Boolean = false,
|
isRelay: Boolean = false,
|
||||||
roffset: number = 0
|
roffset: number = 0
|
||||||
): string {
|
): string {
|
||||||
|
//v2
|
||||||
|
//if (isHttps()) return "wss://" + domain(uri) + "/ws/" + (isRelay ? "relay" : "id");
|
||||||
if (uri.indexOf(":") > 0) {
|
if (uri.indexOf(":") > 0) {
|
||||||
const tmp = uri.split(":");
|
const tmp = uri.split(":");
|
||||||
const port = parseInt(tmp[1]);
|
const port = parseInt(tmp[1]);
|
||||||
|
|||||||
Reference in New Issue
Block a user