I have a VPN established where I do split tunneling with "builder.addallowedapplication()". I would like bypass a few websites from VPN tun0 and rather use the wlan0 interface.
I have tried using the following but doesn't seem to work. Please suggest any corrections.
InetAddress[] inetAddresses = InetAddress.getAllByName("www.speedtest.net");
for (InetAddress ipAddress : inetAddresses) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
String address = ipAddress.getHostAddress();
builder.excludeRoute(new IpPrefix(InetAddress.getByName(address), 32));
}
}
Your code is good but make sure that you have configured the server to support split tunneling and try this code: