feat: tproxy lan gateway, killswitch; fix: zapret2 fixes, various other

This commit is contained in:
FUFSoB committed 2026-09-23 01:12:31 +05:00
1 parent 4bcc168b2a
commit ae8f65da2e
54 files changed
+1880 -143

No files matched your search

@@ -38,14 +38,24 @@ in
(mkDnsServer "local" proxyCfg.dns.local)
];
inbounds = [ ];
# Counters per user, inbound and outbound for proxy-suite-inbound-stats, and who is
# connected right now, on loopback only.
# connected right now, from where. A socket rather than loopback, which any local
# user could ask: the start script's setgid directory gives it the group that may
# read the stats. The listeners are appended at start.
inbounds = [
{
tag = "api-in";
protocol = "dokodemo-door";
listen = "${derived.constants.inboundStatsApiSocket},0660";
settings = {
address = "127.0.0.1";
network = "unix";
};
}
];
stats = { };
api = {
tag = "api";
listen = "127.0.0.1:${toString derived.constants.inboundStatsApiPort}";
services = [ "StatsService" ];
};
policy = {
@@ -95,6 +105,13 @@ in
# IPIfNonMatch the network-only final rule matches names unresolved.
domainStrategy = if proxyInboundsResolveInSingBox then "AsIs" else "IPOnDemand";
domainMatcher = "hybrid";
rules = inboundRules.xrayInboundRules;
rules = [
{
ruleTag = "inbound-stats-api";
inboundTag = [ "api-in" ];
outboundTag = "api";
}
]
++ inboundRules.xrayInboundRules;
};
}
@@ -219,7 +219,7 @@ let
route = {
default_domain_resolver = "local";
rule_set = rules.geositeRuleSets ++ rules.geoIPRuleSets;
rule_set = rules.geositeRuleSets ++ rules.geoIPRuleSets ++ rules.remoteRuleSets;
rules = lib.optionals enableXrayDnsBridge [ xrayDnsBridgeHijackRule ] ++ rules.singBoxRoutingRules;
final = if (proxyCfg.routing.default == "proxy") then "proxy" else "direct";
}