[issue790] Bypassing proxy server fails on Windows

Sebastian Hauer mercurial-bugs at selenic.com
Wed Oct 24 14:39:16 UTC 2007


New submission from Sebastian Hauer <sebastian.hauer at gmail.com>:

Pushing via http to an internal server fails on Windows if a proxy server is
defined in the Windows registry.  Disabling via the Mercurial.ini setting:

[http_proxy]
host = <proxyhost>:<proxyport>
no = <repo_hostname>

shows no effect.
The problems seems to be that a default urllib2.ProxyHandler gets installed even
 when the repository host is on the "no proxy" list (see:
mercurial/httprepo.py).  The default urllib2.ProxyHandler auto-detects the proxy
server on Windows not only by looking at the environment variables HTTP_PROXY,
etc. but also by scanning the Windows registry.
To resolve this problem I patched httprepo.py by appending a ProxyHandler with
no proxies defined in case a host is on the "no proxy" list.

Please find the patch against hg-stable attached.
With the applied patch I am now able to access internal servers (bypassing the
proxy) as well as external ones (going through the proxy).

----------
files: no-proxy-autodetect.patch
messages: 4172
nosy: hauer
priority: bug
status: unread
title: Bypassing proxy server fails on Windows
topic: http_proto

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue790>
____________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no-proxy-autodetect.patch
Type: application/octet-stream
Size: 738 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20071024/2dafa18d/attachment-0002.obj>


More information about the Mercurial-devel mailing list