Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am installing macports on my Mac OS X and for fetching the binaries from the repository it uses rsync protocol. Unfortunately seems the repository is not accessible by direct connection from my machine. So I ran a local proxy program (supports http, https, ftp and socks) and now trying to find out how to redirect the rsync connection through my proxy. Is there anybody who knows about this? Cheers,

share|improve this question

2 Answers 2

man rsync is your friend.

You may establish the connection via a web proxy by setting the environment variable RSYNC_PROXY to a host-name:port pair pointing to your web proxy. Note that your web proxy's configuration must support proxy connections to port 873.

So assuming your proxy is on port 3128, RSYNC_PROXY=localhost:3128 should do what you need.

share|improve this answer

If you use squid for your web proxy, add the two center lines to squid.conf (/etc/squid/squid.conf on most unix systems, or /opt/local/etc/squid/squid.conf in MacPorts):

acl SSL_ports port 443

acl SSL_ports port 873     # ADD THIS FOR RSYNC ACCESS
acl Safe_ports port 873    # ADD THIS FOR RSYNC ACCESS

acl CONNECT method CONNECT

Then, from a shell (if this works you can look at setting it up permanently), type:

export RSYNC_PROXY=proxyhost:proxyport

If your proxy requires a password:

export RSYNC_PROXY=username:password@proxyhost:proxyport

If the above is impossible for you to set up, you can also try this. It requires that you have access via ssh to a server that can act as a proxy.

export RSYNC_CONNECT_PROG='ssh tunnelhost nc %H 873'

The ssh server will have to have 'netcat' installed, almost all do. If not, it can be installed using something similar to:

debian/ubuntu:

apt-get install netcat

centos/redhat

yum install nc
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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