Removing DoH

master
Swissky 2024-06-29 19:36:55 +02:00
parent e43e4d883f
commit 94c6852b62
1 changed files with 7 additions and 7 deletions

View File

@ -53,15 +53,15 @@ class Upstream : ExtractorApi() {
Log.d("mnemo", "Upstream extractor enabled")
// Bypass ISP blocking with DNS over HTTP to resolve the IP for upstream
val dnsDoc = app.get(
"https://cloudflare-dns.com/dns-query?name=upstream.to&type=A",
headers = mapOf(
"accept" to "application/dns-json"
)
).text
// val dnsDoc = app.get(
// "https://cloudflare-dns.com/dns-query?name=upstream.to&type=A",
// headers = mapOf(
// "accept" to "application/dns-json"
// )
// ).text
// Parse JSON string to ApiResponse object
val apiResponse = Json.decodeFromString<ApiResponse>(dnsDoc)
// val apiResponse = Json.decodeFromString<ApiResponse>(dnsDoc)
// Extract the desired value
// val ipAddress = if (apiResponse.Answer.isNotEmpty()) apiResponse.Answer[0].data else "185.178.208.135"