Original url:
https://davelly.wordpress.com/category/%E5%B8%86%E6%A8%AF%E5%92%8C%E6%88%B4%E7%AC%A0%E7%9A%84%E9%82%A3%E4%BA%9B%E4%BA%8B%E5%84%BF/
1,create proxy server。
可以在 *nix 操作系统的命令行中运行:
ssh -D 7777 username@remotehost.com
就可以在本地的 7777 端口打开一个 SOCKS 代理. 这种方式除了可以实现无障碍的访问之外, 如果代理服务器足够快, 那么甚至可以用来加速访问, 比如我就用这样的方式加速在 Apple 的网站上看新电影的预告片.
2,using proxychains(proxifier for windows) as proxy client.
proxychains其功能似乎比 tsocks 要更丰富,配置起来更简单,而且不会那么容易出错。以下有配置方法:
sudo apt-get install proxychains
修改配置文件 (/etc/proxychains.conf),应该如下:
# proxychains.conf VER 2.0
#
# HTTP, SOCKS4, SOCKS5 tunneling proxifier.
#
# The option below identifies how the ProxyList is treated.
# only one option should be uncommented at time,
# otherwise the last appearing option will be accepted
#
# Dynamic – Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# at least one proxy must be online to play in chain
# (dead proxies are skipped)
# otherwise EINTR is returned to the app
#
# Strict – Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# all proxies must be online to play in chain
# otherwise EINTR is returned to the app
#
# Random – Each connection will be done via random proxy
# (or proxy chain, see chain_len) from the list
# this option is good for scans
dynamic_chain
#strict_chain
#random_chain
# Make sense only if random_chain
chain_len = 2
# Quiet mode (no output)
#quiet_mode
# Write stats about good proxies to proxychains.stats
#write_stats
#Some timeouts in milliseconds
#
tcp_read_time_out 15000
tcp_connect_time_out 10000
[ProxyList]
# ProxyList format
# type host port [user pass]
# (values separated by ‘tab’ or ‘blank’)
#
#
# Examples:
#
# socks5 192.168.67.78 1080 lamer secret
# http 192.168.89.3 8080 justu hidden
# socks4 192.168.1.49 1080
# http 192.168.39.93 8080
#
#
# proxy types: http, socks4, socks5
# ( auth types supported: “basic”-http “user/pass”-socks )
#
#http 10.0.0.5 3128
socks5 127.0.0.1 9999
socks4 127.0.0.1 9050
注意事项:
1. 要选 dynamic_chain 而不是 random_chain
2. 可以列举几个代理服务器,proxychains 会按顺序用,代理无法访问即自动选用下一个
3. 代理服务器要根据自己电脑的情况自行调整
运行 proxychains
运行 proxychains 跟运行 tsocks 完全一样。在终端中:
proxychains 你的软件 &
比如说:
proxychains chromium-browser &
我还是推荐你使用 proxychains!