Conversation
There was a problem hiding this comment.
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
isUsingProxymethod 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"]) { |
There was a problem hiding this comment.
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.
| [name hasPrefix:@"ppp"]) { | |
| [name hasPrefix:@"ppp"]) { | |
| freeifaddrs(ifaddr); |
| } | ||
|
|
||
| - (BOOL)isUsingProxy { | ||
| CFDictionaryRef proxyRef = CFNetworkCopySystemProxySettings(); |
There was a problem hiding this comment.
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.
| @@ -701,4 +701,35 @@ - (NSString *)kDeviceId { | |||
| } | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
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.
| /// 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. |
No description provided.