Packet Tunnel Provider in iOS 9

5.7k views Asked by At

iOS 9 has added Packet Tunnel Provider for implementing custom VPN Protocol.But there is no any information available regarding that. Has anyone come across on the implementation using this tunnel provider?

1

There are 1 answers

4
mKane On

Apple has released the Simple Tunnel sample code as shown in WWDC 15'

https://developer.apple.com/videos/wwdc/2015/?id=717

Here is the sample code: https://developer.apple.com/library/prerelease/ios/samplecode/SimpleTunnel/Introduction/Intro.html

You do need to add entitlements in order to run the app properly, to which you must email network support at apple I believe.

However if you download the sample code it is laid out very nice , just reverse engineer how the Packet Tunnel Provider works.

In the most basic terms the PacketTunnelProvider class allows you to set your options when connecting to a tunnel as set in startTunnelWithOption:completionHandler. Where as you pass the completion handler to the TunnelHelper to determine if it is a success or failure.

It is also used to read and write datagrams & handleMessages from the server.