fix: overall tun/tproxy improvements
This commit is contained in:
29 files changed
+445
-149
No files matched your search
@@ -186,7 +186,8 @@ def portable_xray(cfg, only=None):
|
||||
balanced = bool(routing.get("balancers"))
|
||||
rules = []
|
||||
for rule in routing.get("rules") or []:
|
||||
if set(rule.get("inboundTag") or []) - {"mixed-in"}:
|
||||
# "local" and "remote" are DNS servers' own queries: a proxy's name resolves direct.
|
||||
if set(rule.get("inboundTag") or []) - {"mixed-in", "local", "remote"}:
|
||||
continue
|
||||
if rule.get("outboundTag") in dropped:
|
||||
if balanced:
|
||||
|
||||
@@ -77,6 +77,7 @@ def xray_config():
|
||||
"routing": {
|
||||
"rules": [
|
||||
{"type": "field", "inboundTag": ["tproxy-in"], "outboundTag": "direct"},
|
||||
{"type": "field", "inboundTag": ["local"], "outboundTag": "direct"},
|
||||
{"type": "field", "domain": ["geosite:google"], "outboundTag": "proxy-suite-ob-warp"},
|
||||
{"type": "field", "network": "tcp,udp", "balancerTag": "proxy"},
|
||||
],
|
||||
@@ -188,6 +189,7 @@ class XrayTest(unittest.TestCase):
|
||||
self.assertEqual(
|
||||
cfg["routing"]["rules"],
|
||||
[
|
||||
{"type": "field", "inboundTag": ["local"], "outboundTag": "direct"},
|
||||
{"type": "field", "domain": ["geosite:google"], "balancerTag": "proxy"},
|
||||
{"type": "field", "network": "tcp,udp", "balancerTag": "proxy"},
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user