Code Block language https://developer.apple.com/forums/thread/675312
I examine the answer but I think this way not for me, I read the information from a conference WWDC15 “What’s New in Network Extension and VPN”,
Link:
Code Block language https://docplayer.net/24027619-What-s-new-in-network-extension-and-vpn.html
and did find a few solutions but not sure that it will be a good choice.
My goal is to create a connection (VPN or proxy) between the app and server on macOS.
App gives access to web sites and “IF” web site is a blocked application enable VPN, but if user using my app and for example, an app like torrent all files which download using torrent will be to go through my VPN server, I don’t want that, therefore I need connection only between app and server because an app like torrent can kill me.
For this solution, if I understand correct exist few ways:
NEVPNManager - not good because I can’t create an exclusive connection and all traffic from macOS will go through the server, this is a bad way.
NETunnelProvider (NEPacketTunnel Provider or NEAppProxy Provider) - looks good for my situation but this is an “Enterprise solution” and I don’t fully understand what does it mean. I examine the question about “per-app VPN” but this task needs an MDM server(not for me), and I think “NEPacketTunnel Provider or NEAppProxy Provider” also needs MDM server? Because from WWDC15 I saw the label “Per-App VPN” for both.
NEFilterProvider - not for me because this is a “content filter”, my app didn’t filter content, the app gives access to blocked content.
You would have to move the proxy functionality out to the system level and either create a NEAppProxyProvider or use the System Configuration proxy settings to route traffic locally to a process so it can decide where the traffic needs to go. Both are a lot of work and do seem like a bit of overkill for this action. I would try looking into NEFilterDataProvider as a first step here.
if I understand correctly my way is to use the SystemConfiguration proxy system but how does this Programmatically from the app? And in this case, all from macOS will be go through the server I am right or not?
Or use the second way to move the proxy functionality out to the system level, but how do this? And in this case, I can create an exclusive connection between only my app from macOS and the server? I do not fully understand this case.