Repository navigation
Description
客户端网络只有IPV4,服务端IPV4+IPV6,在客户端outbound设置Sockopt.domainStrategy=UseIP,并且连接为域名的时候,XRAY会同时以域名解析出来的IPV4和IPV6(如果有的话)分别各起一条代理连接,但是由于客户端网络只支持IPV4,因此日志里面会不定时出现尝试用IPV6地址连接服务器的WARNING警告(报错)。
但是!!此时代理实际是可以用的。。。上youtube, google , facebook等一切网站都很正常!!!
只是每次切换页面(加载网络资源时)肯定会触发一次IPV6到服务器的连接尝试,导致日志会间隔不断有报错。。。
PS: 这个不是domainStrategy导致的DNS解析死循环,这个很确定。。。
以下是一部分日志 (部分敏感信息作了替换)
2021/03/22 19:22:02 tcp:127.0.0.1:8767 accepted tcp:i.ytimg.com:443 [Socks-In -> Proxy]
2021/03/22 19:22:02 DoH accepted https://223.5.5.5/dns-query [local]
2021/03/22 19:22:02 DoH accepted https://223.5.5.5/dns-query [local]
2021/03/22 19:22:02 tcp:127.0.0.1:13011 accepted tcp:www.youtube.com:443 [Socks-In -> Proxy]
2021/03/22 19:22:03 tcp:127.0.0.1:8261 accepted tcp:fonts.googleapis.com:443 [Socks-In -> Proxy]
2021/03/22 19:22:03 tcp:127.0.0.1:10075 accepted tcp:fonts.gstatic.com:443 [Socks-In -> Proxy]
2021/03/22 19:22:03 DoH accepted https://223.5.5.5/dns-query [local]
2021/03/22 19:22:03 DoH accepted https://223.5.5.5/dns-query [local]
2021/03/22 19:22:03 DoH accepted https://223.5.5.5/dns-query [local]
2021/03/22 19:22:03 DoH accepted https://223.5.5.5/dns-query [local]
2021/03/22 19:22:03 DoH accepted https://223.5.5.5/dns-query [local]
2021/03/22 19:22:03 DoH accepted https://223.5.5.5/dns-query [local]
2021/03/22 19:22:03 tcp:127.0.0.1:2736 accepted tcp:www.youtube.com:443 [Socks-In -> Proxy]
2021/03/22 19:22:03 tcp:127.0.0.1:2811 accepted tcp:www.youtube.com:443 [Socks-In -> Proxy]
2021/03/22 19:22:03 tcp:127.0.0.1:3124 accepted tcp:www.youtube.com:443 [Socks-In -> Proxy]
2021/03/22 19:22:03 tcp:127.0.0.1:2244 accepted tcp:www.youtube.com:443 [Socks-In -> Proxy]
2021/03/22 19:22:03 tcp:127.0.0.1:9073 accepted tcp:i.ytimg.com:443 [Socks-In -> Proxy]
2021/03/22 19:22:04 [Warning] [1624026325] app/proxyman/outbound: failed to process outbound traffic > proxy/vless/outbound: connection ends > proxy/vless/outbound: failed to write A request payload > transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (wss://www.myserver.com:10001/websocket_path): > dial tcp [3000:1700:2031::ac11:a1a1]:10001: connectex: A socket operation was attempted to an unreachable network.
2021/03/22 19:22:04 [Warning] [183302411] app/proxyman/outbound: failed to process outbound traffic > proxy/vless/outbound: connection ends > proxy/vless/outbound: failed to write A request payload > transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (wss://www.myserver.com:10001/websocket_path): > dial tcp [3000:1700:2031::ac11:a1a1]:10001: connectex: A socket operation was attempted to an unreachable network.
客户端DNS配置
{
"hosts": {
"dns.google": "8.8.8.8",
"doh.pub": "119.29.29.29"
},
"servers": [
"https://dns.google/dns-query",
{
"address": "https://1.1.1.1/dns-query",
"domains": [
"geosite:geolocation-!cn"
]
},
{
"address": "https+local://223.5.5.5/dns-query",
"domains": [
"geosite:cn"
],
"expectIPs": [
"geoip:cn"
]
},
{
"address": "https+local://doh.pub/dns-query",
"domains": [
"geosite:cn"
],
"expectIPs": [
"geoip:cn"
]
},
{
"address": "https+local://223.5.5.5/dns-query",
"domains": [
"domain:myserver.com"
]
},
{
"address": "https+local://doh.pub/dns-query",
"domains": [
"domain:myserver.com"
]
},
"localhost"
]
}
目前发现的解决方案是把Sockopt.domainStrategy改成UseIPv4,这样日志里就不会在有尝试IPV6连接服务器的警告了。
期望的修复是,使用UseIP时根据客户端网络自动选择IPV4或IPV6其一进行连接,对于当前只支持IPV4的时候,就固定只用IPV4连接到代理服务器
Activity
emiyalee1005 commentedon Mar 22, 2021
目前只测试了VLESS+WS的情况,其它组合不确定是否也是一样问题
rurirei commentedon Mar 22, 2021
it's a feature, not bug.
you do a feature request.
emiyalee1005 commentedon Mar 22, 2021
不要随便关闭问题好不,这怎么是feature?UseIp至少得判断当前网络支不支持ipv6先啊,至少和服务端的useip保持逻辑一致
emiyalee1005 commentedon Mar 22, 2021
可以判断当当前客户端网络是否存在ipv6地址,没有那就是不支持v6,useip只解析ipv4
rurirei commentedon Mar 22, 2021
because you do a feature request.
emiyalee1005 commentedon Mar 22, 2021
🙃
emiyalee1005 commentedon Mar 22, 2021
我不认为这是feature request,这是一个一个bug,正确设计应该是在一开始以v4或v6地址连上代理后,后续一段时间都是以一开始的地址链接,至少chrome在链接ipv6网站时也是以一开始最早响应的那个地址来执行后续请求
现在是几乎我没每加载任何东西都会冗余请求一次v6地址,浪费了带宽,也污染了日志
emiyalee1005 commentedon Mar 22, 2021
看油管视频,每2到3秒刷一次这种错误,这个难道是正常?