How to force the rsync to use my proxy settings?

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.


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