可以参看这个文章
http://ha.ckers.org/ssh_proxy.html
简单步骤如下
编辑 ~/.ssh/config
加入如下内容
HostName somehost.com (or an IP address)
User username
Compression yes
LocalForward *:80 127.0.0.1:8080
其中 LocalForward 80 127.0.0.1:8080
更多的配置参数可以 man ssh_config 进一步查看