5

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?

Ashok
  • 499
  • 4
  • 13

1 Answers1

2

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.

mKane
  • 932
  • 13
  • 30
  • Will I be able to run my application in background ? Do I need any special permission from Apple to run my application in background? – Ashok Aug 18 '15 at 11:56
  • @Ashok You will be able to run your extension in the background. Have that handle your processing and have your app query the data from the extension. Yes you need to add the correct entitlements for a Vpn application. – mKane Aug 18 '15 at 12:16
  • Thanks for your inputs. In the sample app provided by Apple, encapsulation and decapsulation of data is done in native language(swift), what in case i have my processing code in c and cpp (compiled and linked as static library to app).Does this work in background else do i have to port everything to native(swift) ? – Ashok Sep 28 '15 at 12:27
  • 1
    The Sample Code itself already contains the entitlement, didn't they work? – Lanston Dec 09 '15 at 06:26