OSX Firewall CLI
To list:
sudo /usr/libexec/ApplicationFirewall/socketfilterfw —listapps
To add an application to the firewall:
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /Users/clarkeb/go/src/github.com/gowiki/wiki
To get the state of application that has been added to the firewall:
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --getappblocked /Users/clarkeb/go/src/github.com/gowiki/wiki
To unblock an application that has been added to the firewall:
sudo /usr/libexec/ApplicationFirewall/socketfilterfw —unblockapp /Users/clarkeb/go/src/github.com/gowiki/wiki
So, when regularly compiling a binary, run the following each time to save time:
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --remove /Users/clarkeb/go/src/github.com/gowiki/wiki && \ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /Users/clarkeb/go/src/github.com/gowiki/wiki && \ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblock /Users/clarkeb/go/src/github.com/gowiki/wiki