Hi,
I've been attempting to create a app that can read in user traffic and then route it normally.
Essentially, I've been using NEPacketTunnelProvider with a test linux server as a VPN, and have been routing traffic through that. I can successfully perform traffic routing with this client/server setup.
Now what I want is to perform this without the server.
I've been successful with performing DNS requests and getting back responses, and I've confirmed this using Wireshark. What I don't understand is why there are no subsequent requests leading to an HTTP/s request being generated and getting passed into the TunnelProvider. Instead, more DNS requests are being fired as if the client never got the response.
I'm passing back the response data into the packetFlow object, with IP and UDP headers that I construct manually since the UDPSession object strips those headers off, and I'm matching the data as much as I can with how it would be had I still had the linux server. The only aspects I can't replicate would be the TTL and packet ID, but they shouldn't have any significant effect so I generate them randomly.
Despite the IP and port information being correct, the client phone never seems to process the response packets. This never happens when using the client/server structure for the VPN. I don't understand what difference is preventing the phone from reading those response packets.