I have written the Transparent App Proxy and can capture the network flow and send it to my local server. I want to avoid any processing on the traffic outgoing from my server and establish a connection with a remote server, but instead of connecting to the remote server, it again gets captured and sent back to my local server.
I am not getting any clue on how to ignore these flows originating from my server.
Any pointers, API, or mechanisms that will help me?
Your transparent proxy provider has methods like handleNewFlow(_:)
where it decides whether it wants to handle the flow or not. Those methods are given the flow, that is, an object of type NEAppProxyFlow
[1]. That object has a metaData
property, with information about the origin of the flow. This has a few properties for identifying that origin. The right one to use is platform specific [2]. On the Mac you want sourceAppAuditToken
, which you can feed into the code signing machinery to identify the main executable of the process in which the flow originated.
That last step is something I’ve discussed a bunch of times here on the forums, for example, here. That post has a warning about how to securely identify code. Heed it! To learn more about designated requirements, see TN3127 Inside Code Signing: Requirements.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Which is actually one its subclasses.
[2] While transparent proxies are only supported on the Mac, NEAppProxyFlow
is also used by app proxies, which are supported on other platforms.