プロキシをモバイルネットワーク通信で使う
Wi-Fi接続時だと設定アプリからプロキシ(Manual/PAC両方可)を設定できるが、モバイル通信接続時にはそのような項目はない。
※ここでいうManualはプロキシサーバーのIPアドレスを明示的に指定するもので、
PACはProxy Auto-Configurationの略。PACの実態はJavaScriptであり、条件式等JavaScriptの構文を使って、
柔軟にプロキシの設定ができるもの。
そこでプロファイル(.mobileconfig)の出番。
.mobileconfigでは、Manualのプロキシの設定ができる。
その作成や編集はApple Configuratorアプリ(Mac対応)で視覚的に行えるほか、
.mobileconfigファイルの実態はXMLのため、各種コードエディタで編集が容易にできる。
元となる.mobileconfigは各種モバイルキャリアのWebサイトに「APN設定プロファイル」のような名前で公開されている。
その「APN設定プロファイル」にキーと値の組を追加し、プロキシ接続の設定ができる。
code:povo.mobileconfig
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>ConsentText</key>
<dict>
<key>default</key>
<string>povo APN設定プロファイル
本プロファイルをiOS端末にインストールすることで、povoのサービスをご利用いただけます。
動作確認済機種の詳細は、povoのホームページをご確認ください。</string>
</dict>
<key>PayloadContent</key>
<array>
<dict>
<key>APNs</key>
<array>
<dict>
<key>AllowedProtocolMask</key>
<integer>3</integer>
<key>AllowedProtocolMaskInRoaming</key>
<integer>3</integer>
<key>AuthenticationType</key>
<string>CHAP</string>
<key>DefaultProtocolMask</key>
<integer>3</integer>
<key>Name</key>
<string>povo.jp</string>
<key>ProxyPort</key> // プロキシサーバーのポートを指定
<integer>9090</integer>
<key>ProxyServer</key> // プロキシサーバーのIPアドレスを指定
<string>100.67.191.92</string>
</dict>
</array>
<key>AttachAPN</key>
<dict>
<key>AllowedProtocolMask</key>
<integer>3</integer>
<key>AuthenticationType</key>
<string>CHAP</string>
<key>Name</key>
<string>povo.jp</string>
</dict>
<key>PayloadDescription</key>
<string>モバイルデータ通信設定を構成します</string>
<key>PayloadDisplayName</key>
<string>モバイル通信</string>
<key>PayloadIdentifier</key>
<string>com.apple.cellular.BB4AF8CC-123E-478E-B87B-E24FDE975B0B</string>
<key>PayloadType</key>
<string>com.apple.cellular</string>
<key>PayloadUUID</key>
<string>BB4AF8CC-123E-478E-B87B-E24FDE975B0B</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDescription</key>
<string>povo APN設定プロファイル</string>
<key>PayloadDisplayName</key>
<string>povo for iOS</string>
<key>PayloadIdentifier</key>
<string>com.kddi.povo.profile</string>
<key>PayloadOrganization</key>
<string>KDDI CORPORATION</string>
<key>PayloadRemovalDisallowed</key>
<false/>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>0F51224F-55A5-4E59-882F-1BD7B5627033</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>