From 432f3570bf64f5d415149c6f4fefaf49ac712d73 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Wed, 9 Oct 2024 11:43:44 +0200 Subject: [PATCH] HTTP - Allow Transparent --- web/assets/js/model/xray.js | 11 ++++++-- web/html/xui/form/protocol/http.html | 38 +++++++++++++++------------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index e6143254..00b85448 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -2137,9 +2137,14 @@ Inbound.SocksSettings.SocksAccount = class extends XrayCommonClass { }; Inbound.HttpSettings = class extends Inbound.Settings { - constructor(protocol, accounts=[new Inbound.HttpSettings.HttpAccount()]) { + constructor( + protocol, + accounts = [new Inbound.HttpSettings.HttpAccount()], + allowTransparent = false, + ) { super(protocol); this.accounts = accounts; + this.allowTransparent = allowTransparent; } addAccount(account) { @@ -2150,16 +2155,18 @@ Inbound.HttpSettings = class extends Inbound.Settings { this.accounts.splice(index, 1); } - static fromJson(json={}) { + static fromJson(json = {}) { return new Inbound.HttpSettings( Protocols.HTTP, json.accounts.map(account => Inbound.HttpSettings.HttpAccount.fromJson(account)), + json.allowTransparent, ); } toJson() { return { accounts: Inbound.HttpSettings.toJsonArray(this.accounts), + allowTransparent: this.allowTransparent, }; } }; diff --git a/web/html/xui/form/protocol/http.html b/web/html/xui/form/protocol/http.html index ff266de5..106ff8e7 100644 --- a/web/html/xui/form/protocol/http.html +++ b/web/html/xui/form/protocol/http.html @@ -1,21 +1,25 @@ {{define "form/http"}} - - - - - - -
{{ i18n "username" }}{{ i18n "password" }}+
- - - - - - - - + + + + + + +
{{ i18n "username" }}{{ i18n "password" }}+
+ + + + + + + + + + +
{{end}} \ No newline at end of file