Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

统一 domainStrategy 行为. #2026

Closed
wants to merge 5 commits into from

Conversation

rui0572
Copy link
Contributor

@rui0572 rui0572 commented May 3, 2023

#2014 (comment)

        {
            "tag": "outbound-freedom",
            "protocol": "freedom",
            "settings": {
                "domainStrategy": "ForceIP"
// "domainStrategy" 增添如下选项: "UseIPv6v4", "UseIPv4v6", "ForceIP", "ForceIPv6", "ForceIPv4", "ForceIPv6v4", "ForceIPv4v6"
            }
        }

@RPRX
Copy link
Member

RPRX commented May 4, 2023

感谢 PR,原来那么多 alias 是 freedom 的代码教的

我觉得这个,茴香豆的茴有几种写法,大可不必。我们文档只写了一种,应该把其它的都删掉,并且 default 报错。

@rui0572
Copy link
Contributor Author

rui0572 commented May 4, 2023

我们文档只写了一种,应该把其它的都删掉

正确的.

@rui0572 rui0572 force-pushed the freedom-XdomainStrategy branch from adf552d to 24313e3 Compare May 4, 2023 06:57
@rui0572 rui0572 force-pushed the freedom-XdomainStrategy branch from 24313e3 to 4634bef Compare May 4, 2023 07:01
proxy/freedom/config.go Outdated Show resolved Hide resolved
@rui0572 rui0572 force-pushed the freedom-XdomainStrategy branch from a353f0c to 5195f97 Compare May 4, 2023 09:49
@rui0572
Copy link
Contributor Author

rui0572 commented May 4, 2023

已经做出调整.

@RPRX
Copy link
Member

RPRX commented May 6, 2023

有 localAddr,感觉逻辑不太对,要不把它删了?

@rui0572
Copy link
Contributor Author

rui0572 commented May 6, 2023

https://github.com/XTLS/Xray-core/pull/2026/files#diff-d9ceb59d627b1c426e2f1cb9c5ab3d8e457e50370639a01ff4f9180bed900d08R64

现在是配置了 sendThrought 且使用任何一个 IP 相关的 Strategy 时表现为强制解析对应类型的地址且无 Fallback 行为。

删掉的话,那我们就 Let it crash?

PS. *ray 看起来有点舍不得 crash 的感觉

@RPRX
Copy link
Member

RPRX commented May 6, 2023

应遵循文档行为 https://xtls.github.io/config/outbounds/freedom.html#outboundconfigurationobject

只有 UseIP、ForceIP 自动判断 sendTrough,其它的该炸就炸

此外这里也有个 domainStrategy https://xtls.github.io/config/transport.html#sockoptobject再开一个 PR

@RPRX

This comment was marked as outdated.

@RPRX
Copy link
Member

RPRX commented May 6, 2023

我们可以把这里的自适应代码删了,改为在配置解析层面实现,比如说,sendTrough 为 IPv4 时:

  1. 只允许填 AsIs、UseIP、UseIPv4、ForceIP、ForceIPv4,其中 UseIP 解析为 UseIPv4,ForceIP 解析为 ForceIPv4
  2. 填其它的就报错

@rui0572
Copy link
Contributor Author

rui0572 commented May 6, 2023

改为在配置解析层面实现

sendThrough 和 domainStrategy 不在同一层,不动接口的话这个应该没法实现.

只有 UseIP、ForceIP 自动判断 sendTrough,其它的该炸就炸

我就先按这个来了.

@yuhan6665
Copy link
Member

感谢!先合了 #2719

@yuhan6665 yuhan6665 closed this Nov 12, 2023
chika0801 referenced this pull request Nov 12, 2023
* 统一 `domainStrategy` 行为.

* Update proto

---------

Co-authored-by: rui0572 <[email protected]>
@maskedeken
Copy link
Contributor

能不能有一种机制,如果目标服务器同时有v4、v6地址,PreferIPv6的话可以先连接v6地址,如果失败再连接v4地址?

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.

4 participants