设置opera通过ssh代理上网

firefox下使用ssh很方便,因firefox本身支持socks代理。而opera不支持socks代理,一直想在opera下使用ssh,网上有ssh+privoxy教程,都是转的同一文章,可惜说的不详,按照其设置不能成功。
于是自己查阅了相关资料,成功在opera下通过ssh代理上网。先简单说下原理,ssh代理上网:浏览器  -> Secure Tunnel -> SSH Server  -> Web Server
opera不支持socks代理,所以使用Privoxy将socks转换成http代理。 SSH -> SOCKS代理(SSH Tunnel) -> HTTP代理(Privoxy)
下载MyEntunnelPrivoxy并安装。首先必须要有ssh账号,设置MyEntunnel,记下Dynamic SOCKS Port的端口号,这是socks代理端口。
编辑Privoxy安装目录下配置config.txt,添加一行"forward-socks4a   /               127.0.0.1:8080 ."
""不要,.不能少,8080是socks代理端口,即MyEntunnel的Dynamic SOCKS Port。这是对外连接到Internet全通过socks代理。If http_parent is ".", then requests are not forwarded to another HTTP proxy but are made (HTTP-wise) directly to the web servers, albeit through a SOCKS proxy.
socks4和socks4a的区别:
socks4:在本地DNS解析域名。socks4a:在代理服务器DNS解析域名。
The difference between forward-socks4 and forward-socks4a is that in the SOCKS 4A protocol, the DNS resolution of the target hostname happens on the SOCKS server, while in SOCKS 4 it happens locally.
接下来,在opera中设置代理服务器为HTTP端口为8118就可以通过ssh代理上网了。8118是Privoxy的默认监听端口,Privoxy配置中对应listen-address  127.0.0.1:8118,一般不用修改。
这样设置后,opera打开的所有网站都通过ssh代理,我个人更倾向于使用自动代理服务器配置pac来设置部分网站使用ssh代理。用pac好处是节省ssh流量,又是独立的文件,opera即使重装也只需设置一个地方。
欢迎指出错误之处,如转载请注明出处。
 

2 thoughts on “设置opera通过ssh代理上网

  1. Pingback: [转]设置Opera通过SSH代理上网 - Revo²

  2. Pingback: [转]设置Opera通过SSH代理上网 - Revo²

留下评论