Skip to content

Per-App Proxy (Split Tunneling by Application)

The "Per-App Proxy" feature allows you to fine-tune which programs route traffic through the VPN tunnel and which bypass it directly through your local ISP.

Operating Modes

Whitelist

In this mode, the VPN is active only for selected applications. All other device traffic goes through the regular direct internet connection. * Example: Route only Telegram, YouTube, and your browser through the VPN.

Blacklist

In this mode, the entire device is protected by the VPN, except for selected applications. * Example: Exclude banking apps, government portals, or local streaming services that block foreign IPs.

Platform Support

Platform Implementation Mechanism Status
Android VpnService.Builder.addAllowedApplication and addDisallowedApplication socket isolation 🟢 Fully Supported
macOS Process-based routing (process: [...]) in Xray-core 🟢 Fully Supported
Windows Executable matching (process: ["chrome.exe", ...]) in Xray-core 🟢 Fully Supported
Linux Process and Linux kernel cgroups routing in Xray-core 🟢 Fully Supported
iOS NEPacketTunnelProvider cannot access process Bundle IDs in consumer App Store apps ⚪ DEFERRED (Apple Sandbox Limitation)

iOS Platform Constraint

In iOS consumer App Store sandboxes, NEPacketTunnelProvider receives raw L3 packets from utun without process-level metadata (the NEAppProxyProvider API is restricted strictly to Supervised MDM devices). Consequently, native Per-App Proxy on iOS is formally deferred.

Server-Directed Rule Delivery (3-in-1)

Subscription providers can centrally distribute recommended application lists:

  1. External URL in HTTP Header (Recommended):
    per-app-proxy-mode: blacklist
    per-app-proxy-list: https://provider.com/lists/ru-banking.txt
    
    Using an external URL prevents Nginx/Cloudflare header buffer overflows (502 Bad Gateway error) when handling long package lists.
  2. Directives in Text Subscriptions:
    #per-app-proxy-mode: whitelist
    #per-app-proxy-list: org.telegram.messenger,com.google.android.youtube
    
  3. JSON Subscription Metadata:
    "meta": {
      "perAppProxy": {
        "mode": "blacklist",
        "apps": ["com.sberbank.app", "ru.vtb.mobile"]
      }
    }
    

Protecting User Customizations

If a user manually adjusts application selections in subscription settings, Mole sets an override flag (perAppProxyOverridden). Subsequent background subscription refreshes will not overwrite the user's custom settings.