Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trusted Network Detection #21

Open
PeterMcCaldon-aps opened this issue Aug 12, 2022 · 3 comments
Open

Trusted Network Detection #21

PeterMcCaldon-aps opened this issue Aug 12, 2022 · 3 comments

Comments

@PeterMcCaldon-aps
Copy link

the VPNutil gives us the option to ignore SSID's but it would be nice if it could also ignore specific network ranges or ideally if it detects an internal resource (ping or https connection)

@Timac
Copy link
Owner

Timac commented Aug 12, 2022

Interesting. I assume that you never want to connect to the VPN if a ping to a resource success or fail?
Do you have a more precise example?

@PeterMcCaldon-aps
Copy link
Author

PeterMcCaldon-aps commented Aug 12, 2022 via email

@Timac
Copy link
Owner

Timac commented Aug 12, 2022

@PeterMcCaldon-aps Thanks for the clarification. Such a feature could be implemented in VPNStatus. As a first idea, I would most likely change -(BOOL)shouldPreventAutoConnectOnCurrentSSID to return the BOOL asynchronously in a block. The block would then asynchronously execute [neService connect]; if the resource is available.

The function shouldPreventAutoConnectOnCurrentSSID could be expanded to not only check for the SSIDs to be ignored but also test if the resource is available. Finally a preventConnectIfResourceDetected function containing the list of resources to check could be added similar to ignoredSSIDs:

-(NSArray<NSString *> *)ignoredSSIDs
{
    NSString *ignoredSSIDsString = [[NSUserDefaults standardUserDefaults] stringForKey:kServiceIgnoredSSIDsKey];
    return [ignoredSSIDsString componentsSeparatedByString:@","];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants