Firewall manipulation and URL blocking

Hi there,
I’m designing a small application and I have to block/unblock some URLs on the computer by clicking on a button.
Is there a way, a lib, a guideline to do that with OF?

any answers would help me a lot :slight_smile:

best,

Assuming this is a mac.
You can but you have to use objective c and applescript. AppleScript lets you script the system preferences.

You can learn about applescript here - https://developer.apple.com/library/mac/documentation/AppleScript/conceptual/AppleScriptlangguide/introduction/ASLR-intro.html

after that you can run your script within your app from this - https://developer.apple.com/library/mac/documentation/cocoa/reference/foundation/Classes/NSAppleScript-Class/Reference/Reference.html

It is is also possible via shell script, but it is much more difficult. Have no clue about pc.

yep about mac.
the idea would be to call this from my OF based bin.
is there a way to do that like a lib or ?

Doing a Google search it looks like you can but it will be harder than using applscript.

you have to use this lib - https://developer.apple.com/library/mac/documentation/networking/Conceptual/SystemConfigFrameworks/SC-Intro/SC-Intro.html

ok thanks a lot.
http://forum.openframeworks.cc/t/ofw-±applescript-/232/0 can help (reference purpose)