socks is a simple Go library to toggle on and off socks for Mac OS X. It will extract a helper tool and use it to actually chage socks setting.
socks.EnsureHelperToolPresent(fullPath, prompt, iconFullPath)
socks.On(SocksIP,SocksPort string)
socks.Off()
See 'example/main.go' for detailed usage.
pac uses binaries from the socks-cmd project.