How to make proxy server setting take effect for tortoisehg in Windows?
Asked Answered
R

2

8

I set the proxy server in 'global settings' for my tortoisehg in Windows. When I try to connect to bitbucket repositories, the generated command line by tortoisehg was hg clone --debug-- http://bitbucket.org/<path to repo>.

The console shows as follows:

using http://bitbucket.org/<path to repo>
proxying through http://172.19.6.47:8080
http auth: user <username>, password not set
sending capabilities command

I also run wireshark to monitor the traffic. To my surprise the traffic is transferred to bitbucket directly. I thought it should send the packets to the proxy server first. Does it mean that my proxy server does not take effect? What can I do to make it take effect?

Rodomontade answered 20/8, 2012 at 7:41 Comment(0)
S
4

Your mercurial.ini file should have a section like so:

[http_proxy]
host = aproxy.somedomain.com:1234

Check that it is present. Maybe it wasn't saved correctly?

I made a fake entry as above and tried a pull and immediately got a failure to connect to proxy.

Staton answered 21/8, 2012 at 4:4 Comment(2)
I edited the file with tortoisehg GUI and I confirmed the result correct after I read the generated mercurial.ini. But I clearly saw the TCP SYN sent to bitbucket directly, with my proxy setting ignored. And of course I saw a timeout error (URLError: [Errno 10060] ) since I did not have direct Internet connection. Are you using tortoisehg on Windows? What version of mercurial are you using?Rodomontade
I am using the latest TortoiseHg 2.4.2 on Windows.Staton
S
3

The following two webpage have a right answer.

(1) http://d.hatena.ne.jp/falkenhagen/20091007/1254909363

(2) http://www.jameswampler.com/2010/06/10/configure-mercurial-hg-to-use-a-proxy-server/

From the second link, he says:

My laptop is behind our corporate firewall for most of the day, so being able to do an hg push/pull against bitbucket.org fails because it isn’t hitting or proxy server. To setup Mercurial to use a proxy server, edit your hrgc file in the .hg folder of your repository and add this section:

[http_proxy]
host = foo.bar:8000
passwd = password
user = username

Just change the values to your proxy server hostname and port, username and password.

Selfabsorbed answered 7/11, 2014 at 0:57 Comment(3)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewAverse
@DamianKozlak, I have modified the answer, please kindly check it.Selfabsorbed
Good, it's much better.Averse

© 2022 - 2024 — McMap. All rights reserved.