Skip to content

Commit

Permalink
[bug] fix routing dns strategy #1300
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza0 committed Dec 8, 2023
1 parent f2f066a commit f46ed62
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions web/html/xui/xray.html
Original file line number Diff line number Diff line change
Expand Up @@ -969,15 +969,17 @@ <h2 class="collapse-title">
freedomStrategy: {
get: function () {
if (!this.templateSettings) return "AsIs";
freedomOutbound = this.templateSettings.outbounds.find((o) => o.protocol === "freedom" && !o.tag);
freedomOutbound = this.templateSettings.outbounds.find((o) => o.protocol === "freedom" && o.tag == "direct");
if (!freedomOutbound) return "AsIs";
if (!freedomOutbound.settings || !freedomOutbound.settings.domainStrategy) return "AsIs";
return freedomOutbound.settings.domainStrategy;
},
set: function (newValue) {
newTemplateSettings = this.templateSettings;
freedomOutboundIndex = newTemplateSettings.outbounds.findIndex((o) => o.protocol === "freedom" && !o.tag);
if (!newTemplateSettings.outbounds[freedomOutboundIndex].settings) {
freedomOutboundIndex = newTemplateSettings.outbounds.findIndex((o) => o.protocol === "freedom" && o.tag == "direct");
if(freedomOutboundIndex == -1){
newTemplateSettings.outbounds.push({protocol: "freedom", tag: "direct", settings: { "domainStrategy": newValue }});
} else if (!newTemplateSettings.outbounds[freedomOutboundIndex].settings) {
newTemplateSettings.outbounds[freedomOutboundIndex].settings = {"domainStrategy": newValue};
} else {
newTemplateSettings.outbounds[freedomOutboundIndex].settings.domainStrategy = newValue;
Expand Down

0 comments on commit f46ed62

Please sign in to comment.