-
Notifications
You must be signed in to change notification settings - Fork 4.9k
perf(dns): cache network capability check #5244
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
Conversation
|
It doesn't matter which OS the Xray-core runs on, (people may use windows with mobile-data-hotspot) this PR break my Serverless functionality and should not be merged. if you want to check system support-ips only once please add |
|
下一秒又该说会抱着 linux 笔记本乱跑了 |
|
你这个 server-less-iran 具体有多少人在用不好说 单看上手难度,core 根本没有 tun 还非得优先 ipv6 不可,v4 不能用吗? 退一万步就算非要 v6 那么小众,极端,不知道能存活几天的需求 再加个所谓的 useSystemOnce 选项浪费用户心智 眼里只有自己? |
|
I worked hard for "Serverless" for 6 months and now it works great. I add these option for that. first you say this option is useless, and then you decide to change it's functionality, it is not acceptable. /// so please add /// Please let's work together, not fight. |
|
now, thousands of people use "Serverless", there are many forked-versions of it in many Iranian-telegram-channels. second, most Instagram IPv4 is blocked in Iran, but all IPv6 is not blocked, so users with IPv6-system should access Instagram immediately. |
|
伊朗用户 请证明它的合理性 |
|
@patterniha 这么特殊能不能搞个伊朗专用fork啊,各自发展不好吗 |
+1,一颗xxx坏了一锅汤 |
I add /// also, i add many features that is not related to Serverless, Xray-core is core It must meet all needs, not destroy one party's need to meet another's. |
|
此 PR 不会破坏你声称的 “成千上万伊朗人” 都在用的 server-less 功能 如果你硬是要辩解: 我无话可说 |
|
我打个游戏 buff 都没你叠那么多 |
|
you said this option is totally useless: #4666 (comment) /// Instead of pointless discussion, why don't you implement |
|
再糊个 浪费 99.999999% 用户心智 |
|
First, you haven't added the "windows" yet, i write this comment with using serverless in windows with mobile-hotspot!!! also, it is definitely better to add another option instead of separating OS. |
|
I think about that again, we can cache system network-status-information and only if network-status-information changes we try to bind a port again. so there is no need for after implementing that, i close this PR, OK? |
|
你之前自己说只要 cover 手机就够了 现在你又虚构出有成千上万”抱着笔记本到处跑还必须得用 tun 高强度刷 ins 少了一秒都不行一天连八百次不支持 ipv6 wifi 大街上也得连手机热点刷 ins 的不知道哪天就被封的伊朗 server-less 用户“ 就算 下一秒成千上万抱着 linux 笔记本...... 到处跑的伊朗用户又来了 |
如果你想的话,请自己开一个新的 PR |
|
|
|
你虚构出成千上万”抱着笔记本到处跑还必须得用 tun 高强度刷 ins 少了一秒都不行一天连八百次不支持 ipv6 wifi 大街上也得连手机热点刷 ins 的不知道哪天就被封的伊朗 server-less 用户“ 是心平气和地讨论? |
|
此 PR 最多把 来 cover 你声称的 0.0000001% ”抱着笔记本到处跑还必须得用 tun 高强度刷 ins 少了一秒都不行一天连八百次不支持 ipv6 wifi 大街上也得连手机热点刷 ins 的不知道哪天就被封的伊朗 server-less 用户“ |
|
My Instagram-example is just example, after changing dual-stack nerwork to ipv4-only-network, if we still return IPv6 for UDP, it causes data failed to send. Network may changes in any OS, and this problem is not related to OS. |
|
你的 dial udp 开销太大 你所声称的场景是 eeeeeeeeeeedge case,脱离实际需求 |
请问可以提供一个选择吗,Linux DNS只探测一次说实话不友好。 |
|
对于 Linux 笔记本用户来说: 除非你是:直连流量必须用 UDP v6 + 频繁切换到没有 v6 的环境 + 不能重启 xray-core |
有时会遇到,我想这个用到Windows上对Windows来说也是不友好的。只是对于经常宅在一处的人来说无感知。 |
Windows 和 macOS 是可以排除的 Linux 用户为什么不考虑给 systemd 挂一条命令重启 xray? |
不希望与系统耦合 |
|
Linux 增加命令 排除在外是否可以?没输命令就检查一次? |
31c0a86 to
9e43e3f
Compare
well
Should it be reported to SELinux? |
Not for now. |
|
没用过 ipv6 不清楚 |
编译了一下,好像软路由从光猫开始往下挂几台路由器,ipv6容易炸, |
|
应该和此 PR 无关,因为 tty 只检查一次 |
|
现在图形平台检测结果缓存 100ms |
我先改一下为路由器改一下tty编译后使用一段时间,来确认是不是这个情况 |
func checkRoutes() (bool, bool) {
if !isGUIPlatform() {
errors.LogInfo(s.ctx, "****** TTY ******")
routeCache.Once.Do(func() {
routeCache.ipv4, routeCache.ipv6 = probeRoutes()
})
return routeCache.ipv4, routeCache.ipv6
}
errors.LogInfo(s.ctx, "****** GUI ******")
routeCache.RWMutex.RLock()加条日志看看,先看看是不是误判,然后如果是 TTY 就更不可能出错了 |
|
一般打开一个网页会有 3~10 次 DNS 解析 现在不至于打开一个网页要监听几十次端口 现在 100ms 内至多两次 |
|
并不会真的发包,只是 bind port 来测试是否存在 ipv4 / 6 的默认路由 |
|
|
解决了,因为来了两个真的在用 Linux 桌面端笔记本的用户 然后桌面端也会被缓存检查结果 100ms |

queryStrategy: UseSystem字面意思是一个万金油且无害的值服务器端用了代价很大
如果没有 code review 谁会知道里面有坑呢?
现在改成移动端每次测试,其它平台只一次现在改成:
这本应是下游而非 core 该做的事情,它们直接监听 network capabilities changed 就行了