I' working on an application using Apple's NetworkExtension framework which should do some basic network traffic filtering. However I've found issues with using Network extension APIs. The application itself is running on custom run loop implementation using kevents, which seems to be the cause of problems. I've tried to create simple application based on Cocoa which uses CFRunLoop internally and everything works there without issues. On the other hand when I've tried to create simple command line application using the APIs won't work either, which is understandable as there is no run loop there. Is there some workaround for this problem without using CFRunLoopSource?
NetworkExtension APIs won't work outside CFRunLoop
On the other hand when I've tried to create simple command line application using the APIs won't work either, which is understandable as there is no run loop there. Is there some workaround for this problem without using CFRunLoopSource?
If you mean that you are trying to create a Network Extension in a command line application, then you should not try to do this. For reasons that you are pointing out, but for also these reasons:
-
You NEED a container app to install and uninstall your extension. Even if you think you do not need it, a GUI is built into the workflow of a Network Extension and so trying to ditch this workflow ends up with many edge cases and problems. Especially if you are working with a Network System Extension.
-
You need a Sandbox. A Network Extension needs a Sandbox and with Command line tools, the Sandbox is optional.
If I misunderstood you in any way, please let me know.
Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com