# VPN capture on iPad and iPhone

> Capture and decrypt the HTTPS requests of apps on your iPhone or iPad while Cloak Proxy is in the background. VPN capture runs the proxy on the device itself, with no Wi-Fi proxy to set and nothing sent anywhere else.

Source: https://docs.subcloak.com/cloak-proxy/ipad/vpn-capture/

In version 1.1 of the iPhone and iPad app, **VPN capture** is the easiest way to see what the apps on your iPhone or iPad send. The Cloak Proxy app runs its proxy on the device and keeps capturing while you use other apps, lock the screen, or close Cloak Proxy. There's no Wi-Fi proxy to set, and it works on cellular too.

iOS shows a **VPN** badge while it's on, because it's built on iOS's VPN interface. But nothing is tunnelled anywhere: Cloak Proxy only gives iOS a proxy setting that points at itself, on the same device. Each request still goes straight to the server the app was talking to, your IP address doesn't change, and nothing is sent to Subcloak.

*[Screenshot: Cloak Proxy's Settings on iPad with Capture set to VPN (Recommended) and the VPN capture section: Status, Capturing in the background, and Turn Off VPN Capture. Settings › VPN capture while it's on.]*

## VPN capture or the Wi-Fi proxy

The app offers two ways to capture its own device's traffic. Pick one on the first screen (**Capture in the background** or **Capture with the Wi-Fi proxy**) and switch any time in **Settings › Capture**.

| | VPN capture | Wi-Fi proxy |
|---|---|---|
| Captures while Cloak Proxy is in the background or closed | Yes | No: keep Cloak Proxy on screen next to the app (Split View, Slide Over or Stage Manager on iPad) |
| Setup | Install the certificate, then **Turn On VPN Capture** | Install the certificate, then set **Settings › Wi-Fi › ⓘ › Configure Proxy** by hand, on each network |
| Cellular | Yes | No (Wi-Fi only) |
| Other devices can use it as their proxy | No (only this device) | Yes, with **Allow other devices** |
| Big uploads | Up to 8 MB each are captured; bigger ones are refused with a message | Any size |
| Bodies recorded | Up to 512 KB each (the rest is passed on, and the request is marked truncated) | Up to 32 MB each |
| Apps that ignore the system proxy | Not captured | Not captured |

On iPhone, VPN capture is the one to use: iOS suspends an app soon after you leave it, and there's no Split View to keep Cloak Proxy on screen.

## Turn on VPN capture

1. On the first screen, tap **Capture in the background**. (Already using the Wi-Fi proxy? Set the Wi-Fi proxy back to **Off**, then choose **VPN** in **Settings › Capture**.)

   The setup guide opens.

2. **Download the profile** and **Install and trust it**, as for [the Wi-Fi proxy](https://docs.subcloak.com/cloak-proxy/ipad/capture-on-this-device/): the guide explains what the certificate allows, serves the profile to Safari, and checks that full trust is on. If you already trusted Cloak Proxy's certificate on this device, these steps show as done.

3. **Turn on VPN capture**: tap **Turn On VPN Capture**. iOS asks: "Cloak Proxy Would Like to Add VPN Configurations". Tap **Allow** and confirm with Face ID, Touch ID or your passcode. This happens only the first time.

   The VPN badge appears in the status bar, and the step turns green.

4. **Test it**: tap **Open example.com in Safari**, then switch back to Cloak Proxy. The request is in the traffic list.

*[Screenshot: Step 3 of the setup guide on iPad, Turn on VPN capture, with the badge VPN capture is on and a drawing of the device's apps going through Cloak Proxy on this device to the servers they talk to. The setup guide's VPN capture step, once it's on.]*

From now on, the status line under the traffic list says **Capturing in the background** while VPN capture is on. Use your apps as usual and come back to Cloak Proxy to see their requests: what was captured while it was in the background or closed appears within a second or two.

> **It stays on until you turn it off:**
> VPN capture keeps running when you close Cloak Proxy, and Cloak Proxy records your apps' requests the whole time (into its own storage on the device). Turn it off when you're done. It doesn't turn itself back on after the device restarts.

## Turn it off

Any of these:

- In Cloak Proxy, **Settings › VPN capture › Turn Off VPN Capture**.
- Long-press the status line under the traffic list and choose **Turn off capture**.
- In the Settings app, open **VPN** and turn off **Cloak Proxy on-device capture**.

To remove it completely, delete the VPN configuration in **Settings › General › VPN & Device Management › VPN**, or delete the app. Deleting the app doesn't remove the certificate profile: remove it in **Settings › General › VPN & Device Management › Cloak Proxy CA › Remove Profile**.

## What works in VPN capture

Everything you do with captured traffic works the same in both methods: the traffic list, search and filters, the inspector, [SSL Proxying](https://docs.subcloak.com/cloak-proxy/capture/ssl-proxying/) for the hosts you choose, Insights, Trace Value and the Privacy Map, export and import.

The debugging tools that change traffic run inside VPN capture, so they apply while Cloak Proxy is in the background too: Map Local (including files picked from the Files app), Map Remote, Rewrite, Scripting, Block List, Allow List, Network Conditions, DNS Spoofing and No Caching. Changes apply at once. Alerts and Mock Sets recording work on the requests as Cloak Proxy reads them, so for requests made while it was in the background they happen when you come back.

- **Breakpoints** pause the request until you answer in Cloak Proxy. If you don't within 5 minutes (Cloak Proxy may be closed), the request goes on unchanged.
- **Repeat** and **Compose** send from VPN capture, so the requests go through the same tools and show in the list.
- **Pause recording** passes traffic through untouched, as on the Mac.
- **Settings › VPN capture** shows the proxy address, how long it's been on, how many requests it captured and how much memory it uses.

## Limits

- **Apps that ignore the system proxy aren't captured.** VPN capture uses the system's proxy setting, as the Wi-Fi proxy does. Most apps use it (anything built on `URLSession`, Safari, WebKit views); some games, video players and apps with their own networking connect directly and don't show up.
- **Only this device.** VPN capture listens on the device itself. To capture other phones or computers, use the Wi-Fi proxy method with **Allow other devices**, or Cloak Proxy for Mac.
- **Sizes.** iOS limits the memory VPN capture may use, so it records the first 512 KB of each body and passes the rest on (the request is marked truncated), and refuses uploads bigger than 8 MB (or several big uploads at once) with an error that says so. Use the Wi-Fi proxy method to capture big uploads.
- **Hosts never sent through it.** `localhost`, `*.local`, link-local addresses, Apple's services that pin their certificates (push notifications, Apple Account sign-in) and sign-in pages that refuse an inspected connection (Google, Microsoft, Okta, Cloudflare's checks) go straight to the network, so they keep working. A sign-in host you choose to [decrypt anyway](https://docs.subcloak.com/cloak-proxy/capture/ssl-proxying/) goes through VPN capture.
- **Another VPN.** iOS runs one VPN at a time. Turning on VPN capture disconnects a work or personal VPN, and the other way round.
- **Not in the Simulator.** VPN capture runs only on a real iPhone or iPad. To capture the iOS Simulator, use [Cloak Proxy for Mac](https://docs.subcloak.com/cloak-proxy/devices/ios-simulator/).

## Troubleshooting

**Turn On VPN Capture asks again every time.** You tapped **Don't Allow** when iOS asked. Tap **Turn On VPN Capture** again and choose **Allow**.

**Requests don't appear.** Check the VPN badge is in the status bar and **Settings › VPN capture** says **Capturing in the background**. If recording is paused, the status line says **Recording paused**. If the app you're testing still doesn't show, it probably ignores the system proxy.

**HTTPS requests show only as encrypted tunnels.** Add the host to SSL Proxying (long-press a request in the list › **Decrypt HTTPS for this host**), and check full trust is on for **Cloak Proxy CA** in **Settings › General › About › Certificate Trust Settings**.

**An app stops working while VPN capture is on.** The app may pin its certificates and reject Cloak Proxy's. Stop decrypting its host, and it passes through encrypted.

**"Some requests captured while Cloak Proxy was closed were dropped".** VPN capture keeps up to 256 MB of captured traffic for Cloak Proxy to read. If it captures more than that before you open Cloak Proxy, the oldest goes.
