In related to my other question "Packet Tunnel Provider + libcurl" https://forums.developer.apple.com/message/285308
I have a VPN app with Packet Tunnel Provider, and the VPN is connected and works as expeceted.
Now I'm trying to add some code at the Extension app, which should access the internet.
I see that the requests doesn't go via the tunnel, so I'm guessing that traffic made at the extension doesn't reach to the packetFlow object.
Am I correct / wrong? Is it a bug or this is the expected behavior? How can I force the traffic at the extension to go through the tunnel?
Only traffic from the Extension itself behaves differently.
Ah, I though you were talking about code outside of the extension. Code within the extension is subject to different rules.
Within the extension you can send data through the tunnel using the following
NEPacketTunnelProvider
methods:
-createTCPConnectionThroughTunnelToEndpoint:enableTLS:TLSParameters:delegate:
-createUDPSessionThroughTunnelToEndpoint:fromEndpoint:
I’m not sure if there’s a way to get high-level APIs, like
NSURLSession
, to go through the tunnel. I suspect not, but if you need a definitive answer I recommend that you open a
DTS tech support incident and I can investigate this properly.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"