Browse Source

Update xray.js

MHSanaei 2 years ago
parent
commit
fe7ce3f74b
1 changed files with 9 additions and 3 deletions
  1. 9 3
      web/assets/js/model/xray.js

+ 9 - 3
web/assets/js/model/xray.js

@@ -1157,8 +1157,11 @@ class Inbound extends XrayCommonClass {
         }
 		
 		 if (this.XTLS) {
-                    params.set("flow", this.settings.vlesses[clientIndex].flow);
+				if (!ObjectUtil.isEmpty(this.stream.tls.server)) {
+				address = this.stream.tls.server;
 				}
+			params.set("flow", this.settings.vlesses[clientIndex].flow);
+			}
 
         const link = `vless://${uuid}@${address}:${port}`;
         const url = new URL(link);
@@ -1246,8 +1249,11 @@ class Inbound extends XrayCommonClass {
             }
         }
 		
-		if (this.XTLS) {
-                    params.set("flow", this.settings.trojans[clientIndex].flow);
+		 if (this.XTLS) {
+				if (!ObjectUtil.isEmpty(this.stream.tls.server)) {
+				address = this.stream.tls.server;
+				}
+			params.set("flow", this.settings.trojans[clientIndex].flow);
 			}
         
         const link = `trojan://${settings.trojans[clientIndex].password}@${address}:${this.port}#${encodeURIComponent(remark)}`;