Skip to content

Commit

Permalink
HTTP - Allow Transparent
Browse files Browse the repository at this point in the history
  • Loading branch information
MHSanaei authored and aircross committed Sep 18, 2024
1 parent b0b797f commit 20bf507
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion web/assets/js/model/xray.js
Original file line number Diff line number Diff line change
Expand Up @@ -2601,9 +2601,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) {
Expand All @@ -2618,12 +2623,14 @@ Inbound.HttpSettings = class extends Inbound.Settings {
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,
};
}
};
Expand Down
3 changes: 3 additions & 0 deletions web/html/xui/form/protocol/http.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
</template>
</a-input>
</a-input-group>
<a-form-item label="Allow Transparent">
<a-switch v-model="inbound.settings.allowTransparent" />
</a-form-item>
</a-form>
{{end}}

0 comments on commit 20bf507

Please sign in to comment.