2
2

More than 5 years have passed since last update.

iOSシステム設定のプロクシ情報を取得する

Last updated at Posted at 2012-09-09

CFNetwork/CFProxySupport のAPIを利用するのが一番スマートそう。

CFNetworkCopySystemProxySettings関数で設定情報を辞書でまとめて取得できる。

プロクシが有効かどうか調べる
  CFDictionaryRef proxySettings = CFNetworkCopySystemProxySettings();
  // 値が0でなければプロクシが有効になっている
  CFNumberRef enable = CFDictionaryGetValue(proxySettings, kCFNetworkProxiesHTTPEnable);

  BOOL isHttpProxySettingsEnable = CFBooleanGetValue(enable);
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2