Skip to content

Direct/Freedom outbound: Skip domain resolution and finalRules when using sockopt.dialerProxy - #6742

Merged
RPRX merged 1 commit into
mainfrom
fix-freedom-dialerproxy
Sep 8, 2026
Merged

RPRX merged 1 commit into
mainfrom
fix-freedom-dialerproxy

Conversation

@patterniha

Copy link
Copy Markdown
Collaborator

#6058 (comment)

When using dialerProxy, the target domain should not be resolved to an IP. Also, with dialerProxy freedom is no longer the final outbound, which makes finalRules invalid, so finalRules should not be applied at all.

…ialerProxy

#6058 (comment)

When using dialerProxy, the target domain should not be resolved to an IP. Also, with dialerProxy freedom is no longer the final outbound, which makes finalRules invalid, so finalRules should not be applied at all.
@Meo597

Meo597 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

据说下游会在 freedom 自己搞一个 dialerProxy
因此这里被设计成尽力而为,不 net.DestinationFromAddr() 但仍可获取 IP 执行 FinalRule

@RPRX

RPRX commented Sep 8, 2026

Copy link
Copy Markdown
Member

@patterniha 话说其它出站有没有这问题?

虽然有点忘了我以前咋说的,但 dialerProxy 属于特殊情况,都应该交给下一棒,类似于要远端解析,不然肯定本地 DNS leak

比如说下一棒是 VLESS,那是代理协议,dial 到哪个 IP 完全取决于 VLESS address,跟上一棒 Freedom 拿到的域名没任何关系

@Meo597

Meo597 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

当时大概是说 v2rayNG 可能会在 freedom 用到 dialerProxy
按照这个模型来的话,finalRules 就必须判,且没有 DNS 泄露问题

@Meo597

Meo597 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

如果是 freedom + dialerProxy VLESS 并且 AsIs 那么就会 DNS 泄露
但不明白为什么要这么配,为啥不直接 VLESS 出

@RPRX

RPRX commented Sep 8, 2026

Copy link
Copy Markdown
Member

v2rayNG 那个用法是 dialerProxy 到 Freedom 以吃到 fragment/noise,不是反过来

我看了下我以前说的 #6058 (comment) #6058 (comment) #6058 (comment) 重复说放过 dialerProxy,不知道你哪里理解岔了

@Meo597 你看下他这个 PR 可以合了吗

@patterniha

Copy link
Copy Markdown
Collaborator Author

@patterniha 话说其它出站有没有这问题?

? In other outbounds, the domain is directly passed to the dialer and is not resolved, It is also the same in freedom without finalRules, but with finalRules, the domain is resolved twice, while it should only be resolved in the dialer.

@patterniha

Copy link
Copy Markdown
Collaborator Author

The usage of v2rayNG is to use a dialer proxy to access the Freedom to handle fragments/noise

now v2rayNG supports finalMask.

@RPRX

RPRX commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

@patterniha 那没事了我就是确认下,等 @Meo597 看过这个 PR 没问题就行了,话说禁掉了很多奇怪的配置,尽快更新文档

Freedom 的 fragment/noise 快被删了,不过 v2rayNG 那个是它自定义了 dialer,而不是 dialerProxy,可能 @Meo597 想岔了

FinalRules 目前在客户端的作用主要是只放行 VLESS reverse 访问授权网段,先考虑跑裸 core,在 v2rayNG 上得自定义配置

@2dust 有兴趣的话可以看一下

@Meo597

Meo597 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

v2rayNG 的那种用法是 dialerProxy 到 Freedom 以获取 fragment/noise,而不是反过来。

我之前理解成反过来,自动脑补成 NG 那边的 freedom 必须要搞点花活才能用,闹了个乌龙

the domain is resolved twice, while it should only be resolved in the dialer.

解析两次不是啥问题有 cache

@Meo597 你看下这个 PR 可以合并了吗

这样的话就没问题了可以合并,DNS 泄露的问题解决了

@Meo597

Meo597 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

文档正在弄,天黑前可以搞定

@RPRX

RPRX commented Sep 8, 2026

Copy link
Copy Markdown
Member

自动脑补成 NG 那边的 freedom 必须要搞点花活才能用

确实是自定义了 dialer 但不是 dialerProxy,反正不关后者的事,v2rayNG 用到的入站默认也不会激活 FinalRules,没冲突

至于自定义配置跑 VLESS Reverse,这个只能祈祷那个 dialer 的 DNS 解析结果和我们是一样的,最好是 @2dust 加个 UI 和例外

@patterniha

patterniha commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator Author

Parsing twice isn't a problem; there's a cache.

No, the dialer may be on another server, Also, applying finalRules is not guaranteed because the domain may be resolved to a blocked-IP in the dialer, but not in current server (unless we pass the resolved ip instead of domain)

@Meo597

Meo597 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

我意思是这个问题已经不存在了,但仍然会解析两次,有缓存,finalRules 不会导致变慢

@RPRX RPRX changed the title Direct/Freedom outbound: Skip domain resolution and finalRules with dialerProxy Direct/Freedom outbound: Skip domain resolution and finalRules when using sockopt.dialerProxy Sep 8, 2026
@RPRX
RPRX merged commit c26d2ed into main Sep 8, 2026
53 of 54 checks passed
@RPRX
RPRX deleted the fix-freedom-dialerproxy branch November 19, 2026 12:26
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.

3 participants