Programmatically Toggle Proxy in Safari

Discussion in 'Mac Programming' started by ninalashes, Oct 9, 2009.

  1. ninalashes
    Expand Collapse
    macrumors newbie

    Oct 9, 2009

    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.

  2. robbieduncan
    Expand Collapse
    Moderator emeritus


    Jul 24, 2002
    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.
  3. Manty
    Expand Collapse
    macrumors member

    Mar 18, 2008
    Lisbon, Portugal

Share This Page