lejianwen 1 year ago
parent
commit
d77191ce0f
2 changed files with 11 additions and 1 deletions
  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 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]);

+ 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 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 4
 var Zt = Object.defineProperty;