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

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

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

+ 1 - 1
resources/web2/js/dist/index.js

@@ -1,4 +1,4 @@
1
-import {getServerConf} from './ljw.js'
1
+import {getServerConf} from `./ljw.js?v=3`
2
 import {F as $t, J as Yt, L as Re, l as P4, m as r, P as ua, s as Xt, z as H4} from "./vendor.js?v=0b990c6e";
2
 import {F as $t, J as Yt, L as Re, l as P4, m as r, P as ua, s as Xt, z as H4} from "./vendor.js?v=0b990c6e";
3
 
3
 
4
 var Zt = Object.defineProperty;
4
 var Zt = Object.defineProperty;