Jelajahi Sumber

HTTP - Allow Transparent

mhsanaei 1 bulan lalu
induk
melakukan
59a84e844c
2 mengubah file dengan 11 tambahan dan 1 penghapusan
  1. 8 1
      web/assets/js/model/xray.js
  2. 3 0
      web/html/xui/form/protocol/http.html

+ 8 - 1
web/assets/js/model/xray.js

@@ -2601,9 +2601,14 @@ Inbound.SocksSettings.SocksAccount = class extends XrayCommonClass {
 };
 };
 
 
 Inbound.HttpSettings = class extends Inbound.Settings {
 Inbound.HttpSettings = class extends Inbound.Settings {
-    constructor(protocol, accounts = [new Inbound.HttpSettings.HttpAccount()]) {
+    constructor(
+        protocol, 
+        accounts = [new Inbound.HttpSettings.HttpAccount()],
+        allowTransparent = false,
+    ) {
         super(protocol);
         super(protocol);
         this.accounts = accounts;
         this.accounts = accounts;
+        this.allowTransparent = allowTransparent;
     }
     }
 
 
     addAccount(account) {
     addAccount(account) {
@@ -2618,12 +2623,14 @@ Inbound.HttpSettings = class extends Inbound.Settings {
         return new Inbound.HttpSettings(
         return new Inbound.HttpSettings(
             Protocols.HTTP,
             Protocols.HTTP,
             json.accounts.map(account => Inbound.HttpSettings.HttpAccount.fromJson(account)),
             json.accounts.map(account => Inbound.HttpSettings.HttpAccount.fromJson(account)),
+            json.allowTransparent,
         );
         );
     }
     }
 
 
     toJson() {
     toJson() {
         return {
         return {
             accounts: Inbound.HttpSettings.toJsonArray(this.accounts),
             accounts: Inbound.HttpSettings.toJsonArray(this.accounts),
+            allowTransparent: this.allowTransparent,
         };
         };
     }
     }
 };
 };

+ 3 - 0
web/html/xui/form/protocol/http.html

@@ -19,5 +19,8 @@
       </template>
       </template>
     </a-input>
     </a-input>
   </a-input-group>
   </a-input-group>
+  <a-form-item label="Allow Transparent">
+    <a-switch v-model="inbound.settings.allowTransparent" />
+  </a-form-item>
 </a-form>
 </a-form>
 {{end}}
 {{end}}