Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to change system-wide proxy settings by Python ?

1,276 views
Skip to first unread message

iMath

unread,
Feb 3, 2013, 10:34:35 AM2/3/13
to
I have already known a valid proxy server(63.141.216.159)and port(8087) which support both http and https protocols ,so how to change system-wide proxy settings to this proxy by Python ?
I use WinXP ,can you show me an example of this ?
thanks in advance !

Kwpolska

unread,
Feb 3, 2013, 10:42:54 AM2/3/13
to iMath, pytho...@python.org

Michael Torrie

unread,
Feb 3, 2013, 1:06:21 PM2/3/13
to pytho...@python.org
There really is no way on any operating system to set a system-wide
proxy that is honored by every program that does http.

However if you can change the one "Internet Settings" proxy
programmatically, any windows app that use the IE browser engine will
pick it up. One method to do this is to interact with the registry.
You can google for the appropriate key. Setting it for all users,
though, is a bit trickier. Your script would need privileges to access
keys in HKEY_LOCAL_MACHINE.

But be warned that other programs like firefox and Chrome will not
automatically know about this setting or honor it. Or any program that
implements its own http requests with sockets. It's not something that
can be enforced as a sort of policy. If you need that kind of
enforcing, you'll have to work with the network hardware to block
un-proxied http and https traffic.
0 new messages