Any version above 5.0.4 no longer works on IPv6 only network
Please read contributing guidelines. Thanks.
Describe the bug From above version 5.0.4, the Android version of shadowsocks, shadowsocks-android no longer works on IPv6 only network, now it always resolves to IPv4 regardless of any configuration combination on both sides. PC clients like the rust and libev ports work as expected.
Server software: Arch Linux x86_64 with shadowsocks-rust 1.14.3 built from AUR Server network: IPv6 only Internet with IPv6 only dnscrypt client, no IPv4 local nor Internet address
To Reproduce Steps to reproduce the behavior:
- Connect to the server using its IPv6 address directly
- Click on
Connected, tap to check connection Success: HTTPS handshake took N ms- Open a browser, go to some dual stack sites, here web.telegram.org
- The browser returnes error connection closed
- On server side this line is registered on systemd:
tcp tunnel [CLIENT_IPV6_ADDR]:40671 -> 149.154.167.99:443 connect failed, error: Network is unreachable (os error 101) 149.154.167.99is actually the A record of web.telegram.org
Expected behavior shadowsocks-android either has an option to select which IP version to resolve first or its resolution behavior is determined by server side configuration, which enables ipv6_only and ipv6_first
Screenshots If applicable, add screenshots to help explain your problem.
Smartphone (please complete the following information):
- Android/Chrome OS version: Android 9, PQ1A.190105.112
- Device: Essential Phone PH-1
- Version: 5.2.6
- Last version that did not exhibit the issue: 5.0.4
Configuration
Put an x inside the [ ] that applies.
- [ ] IPv4 server address
- [x] IPv6 server address
- [ ] Client IPv4 availability
- [x] Client IPv6 availability
- Encrypt method: none
- Route
- [ ] All
- [ ] Bypass LAN
- [ ] Bypass China
- [x] Bypass LAN & China
- [ ] GFW List
- [ ] China List
- [ ] Custom rules
- [x] IPv6 route
- [ ] Apps VPN mode
- [ ] Bypass mode
- Remote DNS: dns.google
- [ ] DNS over UDP
- Plugin configuration (if applicable):
- [ ] Auto Connect
- [ ] TCP Fast Open
- If you're not using VPN mode, please supply more details here:
Additional context
- Versions <= 5.0.4 work only if
Bypass LAN & Chinaroute mode is selected, otherwise it will always resolve to IPv4 (For example you've selectedAllorGFWList) - The
Connected, tap to check connectionworks without problem. When checking connection, it resolvesdns.googleto2001:4860:4860::8844at first and then establishes a connection with IPv6 - Direct IPv6 connection without domain name resolution works without problem as well
- Server side configuration:
{
"server": "INBOUND_IPV6_ADDR",
"server_port": 65535,
"method": "none",
"password": "PASSWORD",
"local_address": "OUTBOUND_IPV6_ADDR",
"dns": "udp://[::1]:53",
"mode": "tcp_and_udp",
"ipv6_first": true,
"ipv6_only": true,
"log": {
"level": 1,
},
}