Programmatically change the system network settings (proxy)

Is there a way inside the Cocoa application to change network settings (in particular, proxy settings). I found that there is a file called preferences.plist in / Library / Preferences / SystemConfiguration that has the necessary settings, but I cannot figure out how to get the system to process the changes in this file without rebooting.

Can this be done programmatically, or at least by running a command? (This solution will probably only be 10.5.x, I guess)

Since I can immediately change these settings in System Preferences, there must be some way, it just eludes me.

Thanks!

+5
source share
1 answer

You want a SystemConfiguration , specifically a Proxies dictionary (see here for more details).

+9
source

All Articles