How to configure a HTTP proxy for svn

SvnProxy

Svn Problem Overview


I want to check code from the repository http://code.sixapart.com/svn/perlbal/ . I can only access the the repository url by setting a proxy. I guess if I want to get the code from the same URL by svn I need to configure a proxy, too. So does anyone of you could tell me how to configure a HTTP proxy in svn?

By the way, I use the command-line svn client under Linux.

Svn Solutions


Solution 1 - Svn

Have you seen the FAQ entry What if I'm behind a proxy??

> ... edit your "servers" configuration file to indicate which proxy to use. The files location depends on your operating system. On Linux or Unix it is located in the directory "~/.subversion". On Windows it is in "%APPDATA%\Subversion". (Try "echo %APPDATA%", note this is a hidden directory.)

For me this involved uncommenting and setting the following lines:

#http-proxy-host=my.proxy
#http-proxy-port=80
#http-proxy-username=[username]
#http-proxy-password=[password]

On command line : nano ~/.subversion/servers

Solution 2 - Svn

You can find the instructions here. Basically you just add

[global]
http-proxy-host = ip.add.re.ss
http-proxy-port = 3128
http-proxy-compression = no

to your ~/.subversion/servers file.

Solution 3 - Svn

In windows 7, you may have to edit this file

C:\Users<UserName>\AppData\Roaming\Subversion\servers

[global]
http-proxy-host = ip.add.re.ss
http-proxy-port = 3128

Solution 4 - Svn

There are two common approaches for this:

If you are on Windows, you can also write http-proxy- options to Windows Registry. It's pretty handy if you need to apply proxy settings in Active Directory environment via Group Policy Objects.

Solution 5 - Svn

In TortoiseSVN you can configure the proxy server under Settings=> Network

Solution 6 - Svn

Most *nixen understand the environment variable 'http_proxy' when performing web requests.

export http_proxy=http://my-proxy-server.com:8080/
svn co http://code.sixapart.com/svn/perlball/

should do the trick. Most http libraries check for this (and other) environment variables.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionHaiyuan ZhangView Question on Stackoverflow
Solution 1 - SvnRich SellerView Answer on Stackoverflow
Solution 2 - SvnKimvaisView Answer on Stackoverflow
Solution 3 - SvnsdafjhjhView Answer on Stackoverflow
Solution 4 - SvnbahrepView Answer on Stackoverflow
Solution 5 - Svnuser3092818View Answer on Stackoverflow
Solution 6 - SvnPeteshView Answer on Stackoverflow