Freedom: Cache UDP resolve result
https://github.com/XTLS/Xray-core/issues/4800#issuecomment-2959273169 道理上udp就不该有fqdn当目标(((((
早看到了 已经改了 不过我回头问了一下 这和你遇到的东西没关系 这只是一个小小的refine
@Fangliding
line 380 and 381 should be swapped
@Fangliding
line 389 and 390 should be swapped
这两行换不换有什么区别么
yes ip.domain() is panic
道理上udp就不该有fqdn当目标(((((
@Fangliding
or we have multiple-IP or we have only-one-domain on single-UDP.
if we have multiple-domain it is impossible to connect response to request.
for example if we have two domain example-1.com and example-2.com, and both resolved to "2.2.2.2" so if we receive response from "2.2.2.2" this is for example-1.com or example-2.com ???
this is logically impossible, and has nothing to do with code.
///
So we never have multiple-domain on single-UDP and there is no need for resolvedUDPAddr-map, only single variable is enough(of course, I haven't deleted it from my PR yet.)
///
TestCommanderListHandlers 极其容易炸
rebase 到 v25.6.8 fbae89d017aee5947598d0a82945b316fdc688ab 就好了
@Fangliding
~I separated my PR from your PR.~
this PR fix WriteMultiBuffer and my PR fix ReadMultiBuffer, and these two PR will solve the UDP problem in Freedom when address is domain or fakedns.
also, you missed a few things in your code:
-
even if
hasStrategyis false, we should load and store from cache. -
if
ForceIPis true, andbuilt-in-DNSfail to resolve-IP, we should not fallback to system-DNS (net.ResolveUDPAddr)
////////////////////
@RPRX
these two PR should merge as soon as possible, and new version should be released.
I think you are aware of the sensitive situation in Iran. we are at war and the internet is very limited.
~~话说现在伊朗基本断外网了还能 Serverless-for-Iran 吗~~
~Now that Iran is basically disconnected from the Internet, is Serverless-for-Iran still available?~
only youtube ~and porn sites~ (of course, I have to change the DNS, I'm waiting for the freedom-UDP problem to be resolved)
///
but the reverse(bridge-portal) method is working great on home-internet with static-IP.
The internet is back to normal. but ipv6 and UDP are still not available.
also, you missed a few things in your code:
- even if
hasStrategyis false, we should load and store from cache.- if
ForceIPis true, andbuilt-in-DNSfail to resolve-IP, we should not fallback to system-DNS (net.ResolveUDPAddr)/////////////////
@Fangliding
Fix 1 and 2, thx.
It's done
算了还是改成之前那样吧 我只是不想把continue写两次 这个use真是烦死了。。
Fix 0 len outbounds
How can the length of outbounds be zero?
And if it is zero, NewPacketWriter will not be executed at all:
we have:
https://github.com/XTLS/Xray-core/blob/1976d02ec9aaff3d34221a18b4ec8869437e2dc6/proxy/freedom/freedom.go#L105-L107
before that and it will panic.
Fix 0 len outbounds
How can the length of outbounds be zero?
And if it is zero,
NewPacketWriterwill not be executed at all:we have:
https://github.com/XTLS/Xray-core/blob/1976d02ec9aaff3d34221a18b4ec8869437e2dc6/proxy/freedom/freedom.go#L105-L107
before that and it will panic.
我这么写可能清楚点 那个ctx可能不是上面看到的ctx 你可以自己用先前的版本试试 就是我在测你昨天那个pr的时候遇到的
i tested and see len(outbounds) is always 0 and your initial-set-map does not perform at all.
NewPacketWriter/NewPacketReader ctx is newCtx define in line-174 and has no outbounds.
so we should copy ctx-outbounds to newCtx-outbounds.
///
I fix it in https://github.com/XTLS/Xray-core/pull/4816.
就这样就行了 不要破坏timeoutonly的语义
~Forget what I said, I hadn't seen your last force-pushed~