I want to intercept all outbound traffic on my Mac the same way Little Snitch does (just, in my code :)).
I can't seem to find any info on how to do this. Are there any libraries I could use for Cocoa for this? Perhaps some Unix library?
Any direction would be appreciated.
You could also use a kernel extension to implement a network socket filter. Developing a kext is more difficult but your program would not depend on the libpcap library. Apple has a code sample at http://developer.apple.com/library/mac/#samplecode/tcplognke/Introduction/Intro.html#//apple_ref/doc/uid/DTS10003669
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With