PDA

View Full Version : Programmatically Toggle Proxy in Safari




ninalashes
Oct 9, 2009, 02:54 AM
Hello,

I have written an application for OSX that toggles browser proxy settings in Safari. The problem is that it requires root-level access in order to function. Is there a programmatic way I can tell Safari to use a proxy server without requiring root access on the computer?

Right now, my application essentially executes:
sudo networksetup -setwebproxystate Ethernet on
... [other networksetup calls] ...

I have scoured the Internet for days now and haven't found a more stable way of changing the proxy in Safari. Applescript is also out of the question.

Any help or direction would be greatly appreciated.

Thanks



robbieduncan
Oct 9, 2009, 04:53 AM
Safari does not have a proxy setting: the machine-global network settings do which is what Safari uses. So the answer is no, there is no way of changing the machine-global settings without requiring an admin username/password.

Manty
Oct 9, 2009, 08:29 PM
Check this (http://lists.apple.com/archives/Macnetworkprog/2007/Dec/msg00043.html).