possible to use scutil to change system HTTP proxy settings?
Not for me so far, but I'm hoping someone can educate me as
to where I'm going wrong.
The first problem is just to determine what key is
appropriate for changing the proxy settings. The "list" command
shows all the current keys. On one of my test machines, there were four
possibilities which looked promising:
Setup:/Network/Service/04B9DBFA-50A0-4362-8F62-BF60FA3352EA/Proxies
Setup:/Network/Service/DEA19F1D-239E-11D9-91E0-000A95A76AFC/Proxies
State:/Network/Global/Proxies
State:/Network/0/Proxies
Here are the settings for these keys on my machine (which
includes some settings from my various experiments that I've done already):
show State:/Network/Global/Proxies
<dictionary{
ProxyAutoDiscoveryEnable : 0
FTPPassive : 1
ExcludeSimpleHostnames : 0
ProxyAutoConfigEnable : 0
AppleProxyConfigurationSelected : 2
}
There were similar settings for the other keys.
As an experiment, I changed the proxy settings from Safari
preference page, establishing an HTTP proxy with a URL of /a/b/c. Then I
returned to scutil to see what effect this had; the data associated w/ the keys
Setup:/Network/Service/DEA19F1D-239E-11D9-91E0-000A95A76AFC/ and
State:/Network/Global/Proxies reflected these changes.
Then from scutil, I changed these settings to be
HTTPProxy : http://nelsons-w2k3.na.plumtree.com
HTTPPort : 4444
for those two keys. I did this with the following commands:
open
lock
d.init
get
Setup:/Network/Service/04B9DBFA-50A0-4362-8F62-BF60FA3352EA/Proxies
d.add ProxyAutoConfigEnable 0
d.add HTTPProxy
http://nelsons-w2k3.na.plumtree.com
d.add HTTPPort 4444
set
Setup:/Network/Service/04B9DBFA-50A0-4362-8F62-BF60FA3352EA/Proxies
unlock
(For brevity I am only showing the sequence for one of the
keys.) I use scutil to show me the contents of these keys again, and it appears
that my changes have been successful. But when I returned to the OS X GUI to
see whether these changes have taken effect, it appears as if I have done
nothing.
This makes me think that there is either some extra level of
caching on the GUI side, or that I am somehow not using scutil correctly. If
it is the latter case, then apparently I'm making changes which are then
visible within scutil's world, but am missing some step which would propagate
these changes out to the rest of the OS X world. I'll be curious to hear any
insights you might have.
-Nelson