Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38106 > unrolled thread

how to change system-wide proxy settings by Python ?

Started byiMath <redstone-cold@163.com>
First post2013-02-03 07:34 -0800
Last post2013-02-03 11:06 -0700
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  how to change  system-wide proxy settings by Python ? iMath <redstone-cold@163.com> - 2013-02-03 07:34 -0800
    Re: how to change system-wide proxy settings by Python ? Kwpolska <kwpolska@gmail.com> - 2013-02-03 16:42 +0100
    Re: how to change  system-wide proxy settings by Python ? Michael Torrie <torriem@gmail.com> - 2013-02-03 11:06 -0700

#38106 — how to change system-wide proxy settings by Python ?

FromiMath <redstone-cold@163.com>
Date2013-02-03 07:34 -0800
Subjecthow to change system-wide proxy settings by Python ?
Message-ID<db0d2f03-15f1-4749-8232-915bd2dc46c3@googlegroups.com>
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 !

[toc] | [next] | [standalone]


#38107 — Re: how to change system-wide proxy settings by Python ?

FromKwpolska <kwpolska@gmail.com>
Date2013-02-03 16:42 +0100
SubjectRe: how to change system-wide proxy settings by Python ?
Message-ID<mailman.1314.1359906203.2939.python-list@python.org>
In reply to#38106
On Sun, Feb 3, 2013 at 4:34 PM, iMath <redstone-cold@163.com> wrote:
> 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 !
> --
> http://mail.python.org/mailman/listinfo/python-list

This may help you:

http://stackoverflow.com/questions/1068212/programmatically-detect-system-proxy-settings-on-windows-xp-with-python

Next time, please use Google before you ask.
-- 
Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
stop html mail                | always bottom-post
http://asciiribbon.org        | http://caliburn.nl/topposting.html

[toc] | [prev] | [next] | [standalone]


#38109

FromMichael Torrie <torriem@gmail.com>
Date2013-02-03 11:06 -0700
Message-ID<mailman.1316.1359914791.2939.python-list@python.org>
In reply to#38106
On 02/03/2013 08:34 AM, iMath wrote:
> 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 !

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.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web