Repository navigation
Conversation
A tunnel can look connected while its packet tunnel extension is gone (iOS ends it under memory pressure): the utun interface stays up but carries nothing, and localdevvpn://enable does nothing because the tunnel already counts as started. localdevvpn://restart loads the tunnel manager first (as the Shortcuts action does, so it also works when the URL cold-launches the app), then TunnelManager.restartVPN() stops the tunnel and starts it again once it reports disconnected, through the existing ShouldStartLocalDevVPNAfterDisconnect path. A tunnel that is not running is just started. With ?scheme=NAME it opens NAME:// once the tunnel has gone down and come back up, or after 10 s at most. Compiled, not run on a device.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A tunnel can look connected while its packet tunnel extension is gone, for example after iOS ends the extension under memory pressure. The utun interface stays up but carries nothing, and
localdevvpn://enabledoes nothing because the tunnel already counts as started. A JIT tool that relies on the tunnel has no way to recover it without the user.Change
New
localdevvpn://restart:TunnelManager.restartVPN()stops the tunnel and starts it again once it reports disconnected, through the existingShouldStartLocalDevVPNAfterDisconnectpath. A tunnel that isn't running is just started.?scheme=NAME, it opensNAME://once the tunnel has gone down and come back up, or after 10 s at most.Testing