-
Notifications
You must be signed in to change notification settings - Fork 6.3k
IPv6 Unreachability Fallback for TLS Configs #4846
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
Maybe we should only do Happy Eyeballs when IPv6 is preferred? |
in v2rayNG, and for proxy-outbound, happy eyeballs only operates when Outbound domain pre-solve method is
if set |
Thank you. I implemented |
where is it? without setting in |
You were right.
|
V2rayNG/app/src/main/java/com/v2ray/ang/handler/V2rayConfigManager.kt
Outdated
Show resolved
Hide resolved
@DHR60 is right, you should replace |
emm,我的意思是 resolvedIps.isNullOrEmpty() == true 时的 bug 要么 if (newHosts.containsKey(domain)) {
item.ensureSockopt().domainStrategy = "UseIP"
item.ensureSockopt().happyEyeballs = StreamSettingsBean.happyEyeballsBean(
prioritizeIPv6 = preferIpv6,
interleave = 2
)
continue
}
val resolvedIps = HttpUtil.resolveHostToIP(domain, preferIpv6)
if (resolvedIps.isNullOrEmpty()) continue
item.ensureSockopt().domainStrategy = "UseIP"
item.ensureSockopt().happyEyeballs = StreamSettingsBean.happyEyeballsBean(
prioritizeIPv6 = preferIpv6,
interleave = 2
) 要么 if (resolvedIps.isNullOrEmpty()) {
item.ensureSockopt().domainStrategy = null
continue
} 不处理会导致 DNS 回环 |
当然,如果你认为这个错误不可能触发,删掉 |
I see, you think we can handle it from core? XTLS/Xray-core#5022 |
? |
حسین ایرانی دیگه؟ مشکلت چیه؟ |
|
I think some things are mixed up, we also have |
اره.الان باید مشکل حل شده باشه |
I think it is okay now. |
没有使用过 happyEyeballs ,请问在真实环境下能有什么优势? |
for example suppose our IP-list is [ip4-1, ip4-2, ip4-3, ip4-4, ip6-1, ip6-2, ip6-3, ip6-4] when interleave is 1 and prioritizeIPv6 is false, the sorted-ip-list is: and when for example interleave is 2 and prioritizeIPv6 is true: then delay 250ms for each attempt until first connection is established. the first-stablished-connection is winner connection and selected for sending/receiving data. |
when we have multiple-IP, this causes a race between ips and it tries to find to the first IP that can be connected. so it solve ipv4/ipv6 unreachable problem. I wrote a full explanation when I implemented it on the core: XTLS/Xray-core#4667 /// also, it only applies when sockopt-domainStrategy is UseIP/ForceIP, and for AsIs mode golang-happy-eyeballs is applied. you can read Xray-core doc for it : https://xtls.github.io/config/transport.html#sockoptobject /// Anyway, this PR has used this feature correctly. |
If the configuration uses TLS and prefers IPv6, but IPv6 is not reachable or ISP not supported, the connection should gracefully fall back to IPv4. To handle this reliably, the core’s built-in Happy Eyeballs function is used to automatically select the best available address family and avoid connection failures.