Hello.. Using Koltin : I'm trying to access an URL that is Blocked in my country and needs to change the DNS or turn on VPN make a successful connection So :
Is there Any way to change the DNS programmatically or is there any other suitable solution to this problem And that my Code :
val url = URL("https://prices2.herokuapp.com/")
val con=url.openConnection() as HttpURLConnection
con.connectTimeout=5000
val inputstream=con.inputStream
val bufferreader=BufferedReader(InputStreamReader(inputstream))
bufferreader.forEachLine {
data+=it
}