This page is largely broken, and so its content is removed. Sorry, I'll fix it soon.
It took me a while to figure this out, so I mention it here, although it seem obvious now. In bash, the following will allow you to rsync on something on the other side of a firewall (assuming you can ssh to somewhere from which you can then route packets to your final destination).
final=host.name.of.final.destination
gw=host.name.of.gw.or.firewall
setup-tunnel() { ssh -f -C -L 8022:$final:22 $gw sleep 10; }
sync-from() { setup-tunnel; rsync -van --rsh="ssh -p 8022" \
localhost:/remote/dir/ /local/dir; }
sync-to() { setup-tunnel; rsync -va --rsh="ssh -p 8022" \
/local/dir/ localhost:/remote/dir/; }