Skip to content

Prefer IP rule over domain rule when SNI has no explicit match - #98

Merged
macronut merged 2 commits into
macronut:mainfrom
Cuthead:fix/tproxy-domain-ip-priority
Aug 7, 2026
Merged

Prefer IP rule over domain rule when SNI has no explicit match#98
macronut merged 2 commits into
macronut:mainfrom
Cuthead:fix/tproxy-domain-ip-priority

Conversation

@Cuthead

@Cuthead Cuthead commented Aug 6, 2026

Copy link
Copy Markdown

TProxy/redirect IP-based inbound previously let any TLS SNI sniff override the IP-matched outbound, collapsing to DefaultOutbound (or disconnecting) when the SNI had no explicit domain rule. Domain rules now take priority when they explicitly match; otherwise IP-inbound connections fall back to the outbound chosen by GetOutboundByIP instead of being overridden.

TProxy/redirect IP-based inbound previously let any TLS SNI sniff
override the IP-matched outbound, collapsing to DefaultOutbound (or
disconnecting) when the SNI had no explicit domain rule. Domain rules
now take priority when they explicitly match; otherwise IP-inbound
connections fall back to the outbound chosen by GetOutboundByIP
instead of being overridden.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Cuthead

Cuthead commented Aug 6, 2026

Copy link
Copy Markdown
Author

Per Matrix discussion:

Cuthead
Yesterday 07:35 PM
fa6e71e
这个造成了一个额外问题:我想要让某些 tproxy 入站 IP 地址段直接走特定接口代理,无需解析域名或者写域名规则。现在它们都默认回退到默认接口出站,无法代理了。 (edited)
让我想起了 V2Ray 的 IPOnDemand 和 IPIfNoMatch 的区别。
Cuthead
Yesterday 07:42 PM
比如臭名昭著的 GitHub 185.199.108.0/22 这个上面有很多域名,我想让这个 IP 段全走代理,无需设置多少域名规则。

@macronut
macronut merged commit 0c21ec6 into macronut:main Aug 7, 2026
1 of 3 checks passed
@Cuthead
Cuthead deleted the fix/tproxy-domain-ip-priority branch August 7, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants