So I want to route *every* packet though my software, so I set packetTunnelProvider default route to attract everything to me.
And then I terminate tcp/udp, parse the payload, and based on the parsing result, some of the sessions I send to my vpn server at a specific IP, but the rest I just open a socket to the destination that the packet was originally going to, and send the data out via that socket.
So for example lets say I get packets to both 1.1.1.1:443 and 2.2.2.2:443 via the packet tunnel provider. I terminate both and decide that I want to send 1.1.1.1:443 to my vpn server, but I send 2.2.2.2:443 on its way by opening a socket to 2.2.2.2:443 and sending the terminated payload out on that socket.
So the thing I am not clear from docs or threads is whether 2.2.2.2:443 will get routed back to my packetTunnelProvider again or not ? In the thread below, @eskimo says that "we specifically go out of our way to ensure that traffic from the packet tunnel provider does not go through any other VPN interface" --> and if thats true, thats *awesome*, thats exactly what I want. But at the same time its written that on macos thats not the case. Can someone confirm if thats the case across all apple OSes please ?
https://developer.apple.com/forums/thread/76711
Android has this call addDisallowedApplication("app-name") where I can add my own app to that list and it will basically do the same as what @eskimo is referring to above. And thats the functionality I am looking for.
And then I terminate tcp/udp, parse the payload, and based on the parsing result, some of the sessions I send to my vpn server at a specific IP, but the rest I just open a socket to the destination that the packet was originally going to, and send the data out via that socket.
So for example lets say I get packets to both 1.1.1.1:443 and 2.2.2.2:443 via the packet tunnel provider. I terminate both and decide that I want to send 1.1.1.1:443 to my vpn server, but I send 2.2.2.2:443 on its way by opening a socket to 2.2.2.2:443 and sending the terminated payload out on that socket.
So the thing I am not clear from docs or threads is whether 2.2.2.2:443 will get routed back to my packetTunnelProvider again or not ? In the thread below, @eskimo says that "we specifically go out of our way to ensure that traffic from the packet tunnel provider does not go through any other VPN interface" --> and if thats true, thats *awesome*, thats exactly what I want. But at the same time its written that on macos thats not the case. Can someone confirm if thats the case across all apple OSes please ?
https://developer.apple.com/forums/thread/76711
Android has this call addDisallowedApplication("app-name") where I can add my own app to that list and it will basically do the same as what @eskimo is referring to above. And thats the functionality I am looking for.