Skip to content

add client-side proxy detection#525

Open
nickpatrick wants to merge 1 commit intomasterfrom
client-side-proxy
Open

add client-side proxy detection#525
nickpatrick wants to merge 1 commit intomasterfrom
client-side-proxy

Conversation

@nickpatrick
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings January 13, 2026 16:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds client-side proxy detection capability to the RadarVerificationManager. The implementation checks for both system-configured proxy settings and VPN/proxy-related network interfaces to detect if the device is routing traffic through a proxy.

Changes:

  • Added isUsingProxy method that detects proxy usage through system proxy settings (HTTP/HTTPS/SOCKS) and network interface inspection (utun, ipsec, ppp)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

NSString *name = [NSString stringWithUTF8String:cur->ifa_name];
if ([name hasPrefix:@"utun"] ||
[name hasPrefix:@"ipsec"] ||
[name hasPrefix:@"ppp"]) {
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Memory leak: When a VPN/proxy interface is detected and the method returns YES here, the ifaddr structure allocated by getifaddrs on line 719 is not freed. This will leak memory each time a proxy is detected via network interfaces. The freeifaddrs call on line 729 will not be reached. Add a freeifaddrs(ifaddr) call before returning YES.

Suggested change
[name hasPrefix:@"ppp"]) {
[name hasPrefix:@"ppp"]) {
freeifaddrs(ifaddr);

Copilot uses AI. Check for mistakes.
}

- (BOOL)isUsingProxy {
CFDictionaryRef proxyRef = CFNetworkCopySystemProxySettings();
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing import: The CFNetworkCopySystemProxySettings function is being used but there is no explicit import for CFNetwork framework. While this may compile due to implicit inclusion, it's best practice to explicitly import CFNetwork at the top of the file with other framework imports.

Copilot uses AI. Check for mistakes.
@@ -701,4 +701,35 @@ - (NSString *)kDeviceId {
}
}

Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing documentation: This new method lacks a comment or documentation explaining what it does, what scenarios it detects (system proxy settings, VPN interfaces like utun/ipsec/ppp), and what the return value represents. Consider adding a brief comment above the method explaining its purpose and behavior.

Suggested change
/// Returns YES if the device appears to be using a network proxy or VPN.
/// Detection is based on:
/// - System proxy settings from CFNetwork (HTTP/HTTPS/SOCKS).
/// - Presence of network interfaces commonly used by VPNs (e.g., utun, ipsec, ppp).
/// Returns NO if no such proxy or VPN-related configuration is detected.

Copilot uses AI. Check for mistakes.
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

Successfully merging this pull request may close these issues.

1 participant