lejianwen 1 год назад
Родитель
Сommit
29d6e36d50
1 измененных файлов с 10 добавлено и 0 удалено
  1. 10 0
      resources/web/js/src/connection.ts

+ 10 - 0
resources/web/js/src/connection.ts

@@ -753,12 +753,22 @@ function getDefaultUri(isRelay: Boolean = false): string {
753 753
   const host = localStorage.getItem("custom-rendezvous-server");
754 754
   return getrUriFromRs(host || HOST, isRelay);
755 755
 }
756
+/*
757
+function isHttps() {
758
+  return window.location.protocol === "https:"
759
+}
760
+
761
+function domain(uri: string) {
762
+    return uri.indexOf(":") > 0 ? uri.split(":")[0] : uri
763
+}*/
756 764
 
757 765
 function getrUriFromRs(
758 766
   uri: string,
759 767
   isRelay: Boolean = false,
760 768
   roffset: number = 0
761 769
 ): string {
770
+    //v2
771
+  //if (isHttps()) return "wss://" + domain(uri) + "/ws/" + (isRelay ? "relay" : "id");
762 772
   if (uri.indexOf(":") > 0) {
763 773
     const tmp = uri.split(":");
764 774
     const port = parseInt(tmp[1]);