Set different timeouts
This commit is contained in:
@@ -47,14 +47,14 @@ object LocalDnsService {
|
||||
val data = data
|
||||
val profile = data.profile!!
|
||||
|
||||
fun makeDns(name: String, address: String, edns: Boolean = true): JSONObject {
|
||||
fun makeDns(name: String, address: String, timeout: Int, edns: Boolean = true): JSONObject {
|
||||
val dns = JSONObject()
|
||||
.put("Name", name)
|
||||
.put("Address", (when (address.parseNumericAddress()) {
|
||||
is Inet6Address -> "[$address]"
|
||||
else -> address
|
||||
}) + ":53")
|
||||
.put("Timeout", 3)
|
||||
.put("Timeout", timeout)
|
||||
.put("EDNSClientSubnet", JSONObject().put("Policy", "disable"))
|
||||
if (edns) dns
|
||||
.put("Protocol", "tcp")
|
||||
@@ -73,10 +73,10 @@ object LocalDnsService {
|
||||
.put("MinimumTTL", 120)
|
||||
.put("CacheSize", 4096)
|
||||
val remoteDns = JSONArray(profile.remoteDns.split(",")
|
||||
.mapIndexed { i, dns -> makeDns("UserDef-" + i, dns.trim()) })
|
||||
.mapIndexed { i, dns -> makeDns("UserDef-" + i, dns.trim(), 9) })
|
||||
val localDns = JSONArray(arrayOf(
|
||||
makeDns("Primary-1", "119.29.29.29", false),
|
||||
makeDns("Primary-2", "114.114.114.114", false)
|
||||
makeDns("Primary-1", "119.29.29.29", 3, false),
|
||||
makeDns("Primary-2", "114.114.114.114", 3, false)
|
||||
))
|
||||
|
||||
when (profile.route) {
|
||||
|
||||
Reference in New Issue
Block a user