fix: tun not working on xray backend

This commit is contained in:
FUFSoB committed 2026-06-08 00:00:08 +05:00
1 parent 39ce4d6be2
commit f060c4cd5e
7 files changed
+523 -45

No files matched your search

+10 -2
View File
@@ -165,7 +165,11 @@ let
xrayFinalRule =
tag:
{ type = "field"; network = "tcp,udp"; }
{
type = "field";
network = "tcp,udp";
ruleTag = "final-default";
}
// (
if tag == "proxy" && proxyCfg.selection == "urltest" then
{ balancerTag = "proxy"; }
@@ -197,6 +201,7 @@ let
tunMtu ? globalTun.mtu,
useOutboundRoutingMark ? false,
enableUrlTest ? proxyCfg.selection == "urltest",
domainStrategy ? "IPIfNonMatch",
}:
{
log.loglevel = "warning";
@@ -251,7 +256,7 @@ let
}
];
routing = {
domainStrategy = "IPIfNonMatch";
domainStrategy = domainStrategy;
domainMatcher = "hybrid";
rules = xrayRouteRules;
}
@@ -315,6 +320,8 @@ let
tunInterface = globalTun.interface;
tunAddress = globalTun.address;
tunMtu = globalTun.mtu;
useOutboundRoutingMark = true;
domainStrategy = "AsIs";
};
xrayPerAppTunTemplate = mkXrayConfig {
@@ -323,6 +330,7 @@ let
tunAddress = perAppTun.address;
tunMtu = perAppTun.mtu;
useOutboundRoutingMark = globalTproxy.enable;
domainStrategy = "AsIs";
};
tproxyTemplate = if xrayEnabled then xrayTproxyTemplate else singBoxTproxyTemplate;