feat: warp/awg and hysteria2 improvements
This commit is contained in:
24 files changed
+676
-18
No files matched your search
@@ -3,6 +3,7 @@
|
||||
pureXrayEnabled,
|
||||
selectionMode,
|
||||
proxyInboundsGuardPrivate,
|
||||
proxyInboundsGuardStrategy ? null,
|
||||
userDnsRules ? [ ],
|
||||
}:
|
||||
|
||||
@@ -120,7 +121,11 @@ else
|
||||
# proxy rules above take stay unresolved and none reaches a direct dial unchecked. Local
|
||||
# mixed-in clients lose names that resolve private. Rules for other inbounds do not count:
|
||||
# autoProxy's direct probe pin would put the guard first, resolving every name, .onion too.
|
||||
| [{inbound: ["mixed-in"], action: "resolve"},
|
||||
| [{inbound: ["mixed-in"], action: "resolve"${
|
||||
lib.optionalString (
|
||||
proxyInboundsGuardStrategy != null
|
||||
) ", strategy: \"${proxyInboundsGuardStrategy}\""
|
||||
}},
|
||||
{inbound: ["mixed-in"], ip_is_private: true, action: "reject"}] as $guard
|
||||
| (.route.rules
|
||||
| map((.outbound? // "") == "direct" and ((.inbound? // ["mixed-in"]) | index(["mixed-in"])) != null)
|
||||
|
||||
@@ -405,12 +405,29 @@ let
|
||||
}
|
||||
// lib.optionalAttrs (routingMark != null) { mark = routingMark; };
|
||||
}
|
||||
// lib.optionalAttrs (ob.domainStrategy != null) {
|
||||
settings.domainStrategy =
|
||||
{
|
||||
prefer_ipv4 = "UseIPv4v6";
|
||||
prefer_ipv6 = "UseIPv6v4";
|
||||
ipv4_only = "UseIPv4";
|
||||
ipv6_only = "UseIPv6";
|
||||
}
|
||||
.${ob.domainStrategy};
|
||||
}
|
||||
else
|
||||
{
|
||||
type = "direct";
|
||||
inherit (ob) tag;
|
||||
bind_interface = ob.interface;
|
||||
domain_resolver = constants.awgDnsServerTag ob.tag;
|
||||
domain_resolver =
|
||||
if ob.domainStrategy == null then
|
||||
constants.awgDnsServerTag ob.tag
|
||||
else
|
||||
{
|
||||
server = constants.awgDnsServerTag ob.tag;
|
||||
strategy = ob.domainStrategy;
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs (routingMark != null) { routing_mark = routingMark; }
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user