Hello,
in my usecase, I want to use the matchDomains
property, so my VPN (NEPacketTunnelProvider
) handles traffic for just some apps and not everything that happens on the device.
But settings matchDomains
to anything other than [""]
doesn't seem to work properly.
It works for websites in Safari but in my testing not for other apps. Let's use Instagram as an example:
let proxySettings: NEProxySettings = NEProxySettings()
proxySettings.matchDomains = ["instagram.com"]
With this settings, using the Instagram app doesn't send traffic to my VPN. However if I set something like "theverge.com" as the domain, it gets set to my app.
According to the docs, the matchDomains
uses suffixes:
If the destination host name of a HTTP connection shares a suffix with one of these strings then the proxy settings will be used for the HTTP connection. Otherwise the proxy settings will not be used.
I also tried wildcards like *.instagram.com
without much luck.
How would I go about this? Is there any internal limits on how many domains I can match like this?
Thanks