bypass dns queries for popular sites in china
This commit is contained in:
@@ -118,7 +118,7 @@ class ShadowsocksNatService extends Service with BaseService {
|
||||
Path.BASE + "ss-local.pid")
|
||||
.format(config.proxy, config.remotePort, 8153, config.sitekey, config.encMethod)
|
||||
} else {
|
||||
val conf = ConfigUtils.PDNSD.format("127.0.0.1")
|
||||
val conf = ConfigUtils.PDNSD.format("127.0.0.1", getString(R.string.exclude));
|
||||
ConfigUtils.printToFile(new File(Path.BASE + "pdnsd.conf"))(p => {
|
||||
p.println(conf)
|
||||
})
|
||||
@@ -302,10 +302,17 @@ class ShadowsocksNatService extends Service with BaseService {
|
||||
val http_sb = new ArrayBuffer[String]
|
||||
init_sb.append(Utils.getIptables + " -t nat -F OUTPUT")
|
||||
val cmd_bypass = Utils.getIptables + CMD_IPTABLES_RETURN
|
||||
|
||||
// Bypass proxy servers
|
||||
if (!InetAddressUtils.isIPv6Address(config.proxy.toUpperCase)) {
|
||||
init_sb.append(cmd_bypass.replace("-d 0.0.0.0", "-d " + config.proxy))
|
||||
init_sb.append(cmd_bypass.replace("0.0.0.0", config.proxy))
|
||||
}
|
||||
|
||||
// Bypass DNS servers
|
||||
init_sb.append(cmd_bypass.replace("0.0.0.0", "127.0.0.1"))
|
||||
init_sb.append(cmd_bypass.replace("0.0.0.0", "114.114.114.114"))
|
||||
init_sb.append(cmd_bypass.replace("0.0.0.0", "114.114.115.115"))
|
||||
|
||||
if (hasRedirectSupport) {
|
||||
init_sb
|
||||
.append(Utils.getIptables + " -t nat -A OUTPUT -p udp --dport 53 -j REDIRECT --to "
|
||||
|
||||
Reference in New Issue
Block a user