How can I configure the VPN SDK to exclude specific domains from using the VPN connection?
The VPN SDK allows you to route network traffic through a VPN connection. By default, all internet traffic will use the VPN when the VPN is active. However, the SDK provides the ability to exclude specific domains from using the VPN connection.
In the example app, the domain ip.me is hardcoded to bypass the VPN and use the device's actual IP address. This is done to demonstrate how to configure the SDK to exclude certain domains from the VPN tunnel. The exclusion logic is implemented in the app's code, not the SDK itself. SDK users have the flexibility to specify any domains they wish to exclude from the VPN.
If you want ip.me to also use the VPN connection, simply comment out the line in the app code that excludes this domain. After relaunching the app, ip.me will then route its traffic through the VPN like all other domains.
protectedvoidconnectToVpn(){...publicvoidsuccess(@NonNullBoolean aBoolean){...finalArrayList<String>domains=newArrayList<>(); // domains.add("example.com"); // Commented out the addition of "example.com" domaindomains.add("ip.me");// Added a new domain "example.com" insteadUnifiedSdk.getInstance().getVpn().start(new SessionConfig.Builder().withReason(TrackingConstants.GprReasons.M_UI)......
When connected to a VPN, the IP address you see in the app (current_server) is different from the IP address in the browser when checking public IP.
This is due to the multi-layered infrastructure of the VPN. Here is a simplified overview of how the IP addresses work in a typical VPN setup:
(client) -> -> (VPN server) -> -> (website)
The client (your device) connects to the VPN server using the server's connect IP address. This is the current_server IP that is visible to you.
The VPN server then sends your web requests out to the internet using a different IP address, known as the out IP.
When the requested website receives the web request, it sees the out IP of the VPN server, not the original IP of your client device.
In summary, the client sees the connect IP of the VPN server it is connected to, while the end website sees the out IP that the VPN server uses to relay the web requests. These two IP addresses are intentionally different in the VPN infrastructure.