iOS判断是否开启代理

  + (BOOL)getProxyStatus {
        CFDictionaryRef dicRef = CFNetworkCopySystemProxySettings();
        const CFStringRef proxyCFstr = CFDictionaryGetValue(dicRef, (const void*)kCFNetworkProxiesHTTPProxy);
      CFRelease(dicRef);
      NSString *proxy = (__bridge NSString*)(proxyCFstr);
      if(proxy) {
          return YES;
      }
      return NO;
  }

你可能感兴趣的:(iOS判断是否开启代理)