proxychains.conf详解

proxychains.conf详解

# proxychains-ng
# proxychains.conf  VER 4.x
# 带有DNS的HTTP、SOCKS4、SOCKS5隧道代理

# 下方的选项指定如何处理 ProxyList 。每次只能取消一个选项,多条选项时将只有最后的选项有效。

#dynamic_chain
#
# 动态 - 每条连接将通过链式代理完成,所有代理按其在列表中出现的顺序进行链式连接,必须至少有一条代理在线才能进行链式连接(离线的代理将被跳过)。
# 否则 EINTR 将返回给应用程序。

strict_chain
#
# 严格 - 每条连接将通过链式代理进行,所有代理都按照它们在列表中出现的顺序链在一起,所有代理必须在线才能进行链式连接。
# 否则 EINTR 将返回给应用程序。


#round_robin_chain
#
# Round Robin - 每个连接将通过链式代理完成,链式代理的长度为 chain_len ,所有代理按照它们在列表中出现的顺序进行链式连接,至少有一个代理必须在线,才能在链式中发挥作用(死亡的代理被跳过)。当前代理链的开始是先前调用的代理链中最后一个代理之后的代理。
# 否则将返回 EINTR 给应用程序。 这些语义在多线程环境中不被保证。

#random_chain
#
# 随机 - 每条连接将通过列表中的随机代理(或代理链,见chain_len)完成。
# 这个选项是测试 IDS 的好办法 :)


#chain_len = 2
#
# 只有在 random_chain 的情况下才有意义


#quiet_mode
#
# 安静模式(不从库中输出)

## Proxy DNS requests - no leak for DNS data
## 代理DNS请求--不泄露DNS数据
# (禁用以下3个项目,不代理你的DNS请求)

# 这是使用proxychains4风格的方法来做远程DNS:一个线程被生成,为DNS请求提供服务,并从内部列表(通过remote_dns_subset)分配一个IP。这是最简单(设置方面)和最快的方法,然而在有错误的libcs和非常复杂的软件(如webbrosers)的系统上,这可能无法工作和/或导致死机。

proxy_dns

# 方法 2. 使用旧的 proxyresolv 脚本,以 proxychains 3.1 风格代理 DNS 请求。需要 $PATH 中的 `proxyresolv` 和动态链接的 `dig` 二进制文件。这比 `proxy_dns` 慢得多,不支持 .onion URLs,但可能与 webbrowsers 等复杂软件更兼容。

#proxy_dns_old

# 方法3:使用proxychains4-daemon进程来服务于远程DNS请求。这与线程化的`## 代理DNS请求--不泄露DNS数据
proxy_dns`方法类似,但是它要求proxychains4-daemon已经在指定的地址上运行。
# 注意,如果你在使用这个方法之前没有启动proxychains4-daemon,那么这个过程就会挂起。
#proxy_dns_daemon 127.0.0.1:1053

# set the class A subnet number to use for the internal remote DNS mapping
# we use the reserved 224.x.x.x range by default,
# if the proxified app does a DNS request, we will return an IP from that range.
# on further accesses to this ip we will send the saved DNS name to the proxy.
# in case some control-freak app checks the returned ip, and denies to 
# connect, you can use another subnet, e.g. 10.x.x.x or 127.x.x.x.
# of course you should make sure that the proxified app does not need
# *real* access to this subnet. 
# i.e. dont use the same subnet then in the localnet section
# 设置A类子网号码,用于内部远程DNS的映射
# 我们默认使用保留的224.x.x.x范围。
# 如果被代理的应用程序做了一个DNS请求,我们将从该范围返回一个IP。
# 在进一步访问这个IP的时候,我们将把保存的DNS名称发送给代理。
# 如果一些控制狂的应用程序检查返回的IP,并拒绝 
# 连接,你可以使用另一个子网,例如 10.x.x.x 或 127.x.x.x。
# 当然,你应该确保亲近的应用程序不需要
# 真正访问这个子网。
# 也就是说,不要在localnet部分使用相同的子网。
#remote_dns_subnet 127 
#remote_dns_subnet 10
remote_dns_subnet 224

# Some timeouts in milliseconds
# 一些以毫秒为单位的超时
tcp_read_time_out 15000
tcp_connect_time_out 8000

### Examples for localnet exclusion
## localnet ranges will *not* use a proxy to connect.
## note that localnet works only when plain IPv4 addresses are passed to the app,
## the hostname resolves via /etc/hosts, or proxy_dns is disabled or proxy_dns_old used.
### Localnet 排除的例子
## localnet范围将*不*使用代理进行连接。
##注意,只有当普通的IPv4地址被传递给应用程序时,localnet才能工作。
##主机名通过/etc/hosts解析,或者proxy_dns被禁用或proxy_dns_old被使用。

## Exclude connections to 192.168.1.0/24 with port 80
## 排除与端口80的192.168.1.0/24的连接
# localnet 192.168.1.0:80/255.255.255.0

## Exclude connections to 192.168.100.0/24
## 排除与192.168.100.0/24的连接
# localnet 192.168.100.0/255.255.255.0

## Exclude connections to ANYwhere with port 80
## 排除与80端口的ANYWARE的连接
# localnet 0.0.0.0:80/0.0.0.0

## RFC5735 Loopback address range
## if you enable this, you have to make sure remote_dns_subnet is not 127
## you'll need to enable it if you want to use an application that 
## connects to localhost.
## RFC5735回环地址范围
## If you enable this, you have to make sure remote_dns_subnet is not 127
##如果你想使用一个应用程序,你就需要启用它 
##连接到localhost。
# localnet 127.0.0.0/255.0.0.0

## RFC1918 Private Address Ranges
## RFC1918私人地址范围
# localnet 10.0.0.0/255.0.0.0
# localnet 172.16.0.0/255.240.0.0
# localnet 192.168.0.0/255.255.0.0

### Examples for dnat
## Trying to proxy connections to destinations which are dnatted,
## will result in proxying connections to the new given destinations.
## Whenever I connect to 1.1.1.1 on port 1234 actually connect to 1.1.1.2 on port 443
### dnat的例子
## 试图代理连接到已经dnatted的目的地。
##将导致代理连接到新给定的目的地。
##每当我连接到1234端口的1.1.1.1时,实际上是连接到443端口的1.1.1.2。
# dnat 1.1.1.1:1234  1.1.1.2:443

## Whenever I connect to 1.1.1.1 on port 443 actually connect to 1.1.1.2 on port 443
## (no need to write :443 again)
## 每当我连接到端口443的1.1.1.1时,实际上是连接到端口443的1.1.1.2
##(不需要再写:443)
# dnat 1.1.1.2:443  1.1.1.2

## No matter what port I connect to on 1.1.1.1 port actually connect to 1.1.1.2 on port 443
## 无论我在1.1.1.1端口上连接什么端口,实际上都是在443端口上连接到1.1.1.2的。
# dnat 1.1.1.1  1.1.1.2:443

## Always, instead of connecting to 1.1.1.1, connect to 1.1.1.2
##总是,而不是连接到1.1.1.1,连接到1.1.1.2
# dnat 1.1.1.1  1.1.1.2

# ProxyList format
#       type  ip  port [user pass]
#       (values separated by 'tab' or 'blank')
#
#       only numeric ipv4 addresses are valid
#
#
#        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, raw
#         * raw: The traffic is simply forwarded to the proxy without modification.
#        ( auth types supported: "basic"-http  "user/pass"-socks )
#
[ProxyList]
# add proxy here ...
# meanwile
# defaults set to "tor"
# 在这里添加代理...
# 意思是说
# 默认设置为 "tor"
socks4 	127.0.0.1 9050