iOS Network proxy that routes only my application network via given proxy.

I need a pointer in the direction of implementing the some kind of proxy that tunnels my application traffic to a proxy in iOS app.

Is there a way to meet this requirements via Network Extensions or any other way?

Answered by DTS Engineer in 751988022

Is there a way to meet this requirements via Network Extensions or any other way?

It depends. In a managed setting the site manager can set this up using per-app VPN. If your app is typically used in unmanaged setting then the answer depends on your specific requirements. For example:

  • If your app is focused on URLSession and you want to proxy just that traffic, configure a proxy on your session.

  • In most other situations there’s no straightforward solution. If you control the network connections yourself you can implement your own proxy support. If not — and the most common case here is WKWebView — you’re out of options )-:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

Is there a way to meet this requirements via Network Extensions or any other way?

It depends. In a managed setting the site manager can set this up using per-app VPN. If your app is typically used in unmanaged setting then the answer depends on your specific requirements. For example:

  • If your app is focused on URLSession and you want to proxy just that traffic, configure a proxy on your session.

  • In most other situations there’s no straightforward solution. If you control the network connections yourself you can implement your own proxy support. If not — and the most common case here is WKWebView — you’re out of options )-:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Oh, and you should definitely watch WWDC 2023 Session 10002 Ready, set, relay: Protect app traffic with network relays when it’s released later today. I haven’t yet had a chance to play with this myself, but I expected you’ll find it useful.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

iOS Network proxy that routes only my application network via given proxy.
 
 
Q