Is there a way to reload configuration for a live tunnel?

There isn't a method named 'reloadTunnel' or 'restartTunnel'.

sendProviderMessage -> handleAppMessage(doing stop then start) will get a broken TunnelExtension result.

How to implement a live configuration modification or is there an example?

Thanks

There are two reconfiguration scenarios:

  • From your container app

  • From within your tunnel provider

I’ll cover these in reverse order.


In your tunnel provider, you might receive new configuration information from the VPN server. In that case standard practice is to apply that configuration to the tunnel by calling the setTunnelNetworkSettings(_:completionHandler:) method while the tunnel is still running. If the new configuration is compatible with the old one, the interface will stay ‘up’ and clients won’t notice the change.

You can’t make persistent configuration changes from within your provider, that is, you can’t call the saveToPreferences(completionHandler:) method.


Your container app has two options:

For this to work the provider must use key-value-observing (KVO) to watch for changes on its protocolConfiguration property. If those changes affect the tunnel’s settings, call the setTunnelNetworkSettings(_:completionHandler:) method as discussed earlier.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is there a way to reload configuration for a live tunnel?
 
 
Q