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


Groups > comp.lang.python > #38109

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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <torriem@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.05; 'implements': 0.07; 'key.': 0.07; 'users,': 0.07; 'python': 0.09; 'https': 0.09; 'advance': 0.10; 'enforcing,': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'registry.': 0.16; 'subject:proxy': 0.16; 'system-wide': 0.16; 'settings': 0.16; 'wrote:': 0.17; 'requests': 0.18; 'windows': 0.19; 'app': 0.19; 'appropriate': 0.20; 'sort': 0.21; 'bit': 0.21; 'http': 0.22; 'keys': 0.22; 'example': 0.23; 'script': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'setting': 0.26; 'am,': 0.27; 'privileges': 0.29; 'protocols': 0.29; 'subject: ?': 0.30; 'up.': 0.31; 'subject:change': 0.33; 'to:addr:python-list': 0.33; 'thanks': 0.34; 'something': 0.35; 'there': 0.35; 'received:org': 0.36; 'really': 0.36; 'but': 0.36; 'message-id:@gmail.com': 0.36; 'method': 0.36; 'operating': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'google': 0.39; 'received:192.168': 0.40; 'subject:-': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'kind': 0.61; "you'll": 0.62; 'show': 0.63; 'subject: ': 0.66; 'policy.': 0.71; 'enforced': 0.84; 'subject:system': 0.84
X-Virus-Scanned amavisd-new at torriefamily.org
Date Sun, 03 Feb 2013 11:06:21 -0700
From Michael Torrie <torriem@gmail.com>
User-Agent Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130105 Thunderbird/10.0.12
MIME-Version 1.0
To python-list@python.org
Subject Re: how to change system-wide proxy settings by Python ?
References <db0d2f03-15f1-4749-8232-915bd2dc46c3@googlegroups.com>
In-Reply-To <db0d2f03-15f1-4749-8232-915bd2dc46c3@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1316.1359914791.2939.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1359914791 news.xs4all.nl 6951 [2001:888:2000:d::a6]:44491
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:38109

Show key headers only | View raw


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.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

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

csiph-web