How to program proxy settings

I am trying to change proxy settings on OS X (10.9 and up) programmatically. The only solutions I've found so far seem to have to do with configuring proxy settings separately for each interface. For completeness, they also seem to implicitly include monitoring interfaces going and going, so customizations can be added with added interfaces.

I wrote some test code with SCDynamicStoreSetValue()

that seems to do the right things (i.e. the right stuff comes up if I check with scutil). However, as soon as I change the interfaces (i.e. plug / unplug the wired interface) the settings go away.

I also looked at the modification /Library/Preferences/SystemConfiguration/preferences.plist

, but it appears to also require updating on a per-interface basis, among other issues.

Is there a global / default setting where if the parameter is per-interface

not set the system will revert to this? If so, how can I get / install it?

+3


source to share





All Articles