Why can't Subversion use my proxy on Windows?

Well, technically it can, but it needs some work.

The client I am working for, requires the use of an HTTP proxy to access the Internet. Without a direct access, I had to find out how to make my Subversion client use that, too. I am running SlikSVN on Windows XP:

Subversion command-line client, version 1.5.5-SlikSvn-tag-1.5.5@34877-WIN32

It's a great (and free!) package from a http://www.sliksvn.com/ However, would it be too much to ask for a Windows application to be able to use whatever the OS paradigm for setting up proxies is?

Here is what I needed done and how it didn't work:

C:\work>svn co https://svn.dre.vanderbilt.edu/DOC/MPC/trunk MPC
: OPTIONS of 'https://svn.dre.vanderbilt.edu/DOC/MPC/trunk': Could not resolve hostname `svn.dre.vanderbilt.edu': No such host is known. (https://svn.dre.vanderbilt.edu)

Since my regular development box is Linux, I knew to try checking my home directory for configuration information:

C:\work>dir %USERPROFILE%\.subversion
The system cannot find the path specified.

C:\work>dir %USERPROFILE%\Subversion
The system cannot find the path specified.

Hmm, now what?

After a bit of poking around I re-discovered the very well written FAQ at tigris.org. The important bit I was missing is that on Windows, Subversion is looking in %APPDATA%\Subversion for configuration information.

Just added the info on my proxy:

--- servers.old 2009-01-28 09:25:02.004662000 -0600
+++ servers 2009-01-28 09:13:51.703497100 -0600
@@ -70,12 +65,11 @@
### due to SSL.
[global]
# http-proxy-exceptions = *.exception.com, www.internal-site.org
+http-proxy-host = www-proxy.mycustomer.com
+http-proxy-port = 31060

... And I was back in business:

C:\work>svn co https://svn.dre.vanderbilt.edu/DOC/MPC/trunk MPC
...
Checked out revision 1535.


YMMV! Depending on the type and the configuration of your proxy, you may have to set and/or adjust some of the other server-related parameters in your servers file.

If you are also using another Subversion client, say like the one that comes with Cygwin, then you may want to ensure they are all using the same configuration. The best way to do this is to create a symlink for your ~/.subversion directory to %APPDATA%\Subversion:

$ ln -s "$APPDATA\Subversion" ~/.subversion

1 comment:

  1. Thank you very much for posting this ... it really helped.

    ReplyDelete