51

I'm on laptop (Ubuntu) with a network that use HTTP proxy (only http connections allowed).
When I use svn up for url like 'http://.....' everything is cool (google chrome repository works perfect), but right now I need to svn up from server with 'svn://....' and I see connection refused.
I've set proxy configuration in /etc/subversion/servers but it doesn't help.
Anyone have opinion/solution?

1

7 Answers 7

62

In /etc/subversion/servers you are setting http-proxy-host, which has nothing to do with svn:// which connects to a different server usually running on port 3690 started by svnserve command.

If you have access to the server, you can setup svn+ssh:// as explained here.

Update: You could also try using connect-tunnel, which uses your HTTPS proxy server to tunnel connections:

connect-tunnel -P proxy.company.com:8080 -T 10234:svn.example.com:3690

Then you would use

svn checkout svn://localhost:10234/path/to/trunk
3
  • 20
    there's also ~/.subversion/servers
    – akavel
    Feb 15, 2011 at 15:04
  • 2
    check this, it really works solution Apr 10, 2012 at 13:19
  • Thank you very much! It works like a charm! I'm on windows and I had to install cygwin (subversion + perl + make). Then, I finally installed Net::Proxy module manually (it didn't want to install using cpan install), et voila!
    – Lasneyx
    Jun 7, 2012 at 15:23
47

Ok, this should be really easy:

$ sudo vi /etc/subversion/servers

Edit the file:

[Global]
http-proxy-host=my.proxy.com
http-proxy-port=3128

Save it, run svn again and it will work.

3
  • 1
    Also, be sure to use http:// in the repo url, rather than svn:// Aug 5, 2011 at 11:44
  • 10
    The 'servers' file on Windows is at:~\AppData\Roaming\Subversion\servers
    – bart
    May 18, 2012 at 0:00
  • 1
    Also, make sure to edit it under [global] header in the file like dillera said, not under [groups] which appears first in the file.
    – K.S.
    Oct 9, 2015 at 15:23
2

If you can get SSH to it you can an SSH Port-forwarded SVN server.

Use SSHs -L ( or -R , I forget, it always confuses me ) to make an ssh tunnel so that

127.0.0.1:3690 is really connecting to remote:3690 over the ssh tunnel, and then you can use it via

svn co svn://127.0.0.1/....
1
  • Remote server on windows for SSH I use HTTP tunneling using corkscrew
    – small_jam
    Sep 17, 2008 at 12:32
1

Okay, this topic is somewhat outdated, but as I found it on google and have a solution this might be interesting for someone:

Basically (of course) this is not possible on every http proxy but works on proxies allowing http connect on port 3690. This method is used by http proxies on port 443 to provide a way for secure https connections. If your administrator configures the proxy to open port 3690 for http connect you can setup your local machine to establish a tunnel through the proxy.

I just was in the need to check out some files from svn.openwrt.org within our companies network. An easy solution to create a tunnel is adding the following line to your /etc/hosts

127.0.0.1 svn.openwrt.org

Afterwards, you can use socat to create a tcp tunnel to a local port:

while true; do socat tcp-listen:3690 proxy:proxy.at.your.company:svn.openwrt.org:3690; done

You should execute the command as root. It opens the local port 3690 and on connection creates a tunnel to svn.openwrt.org on the same port.

Just replace the port and server addresses on your own needs.

0

when you use the svn:// URI it uses port 3690 and probably won't use http proxy

0

svn:// doesn't talk http, therefor there's nothing a http proxy could do.

Any reason why http doesn't work? Have you considered https? If you really need it, you probably have to have port 3690 opened in your firewall.

0

If you're using the standard SVN installation the svn:// connection will work on tcpip port 3690 and so it's basically impossible to connect unless you change your network configuration (you said only Http traffic is allowed) or you install the http module and Apache on the server hosting your SVN server.

Not the answer you're looking for? Browse other questions tagged or ask your own question.