Hi,
I am using open ziti this one ziti-tunnel-android/app/src/main/java/org/openziti/mobile/fragments/IdentityDetailFragment.kt at main · openziti/ziti-tunnel-android but in the identitydetailscreen i am unable to browse the service if you want more detail i can share clickable(enabled = isEnabledState.value) {
urls.forEach { url ->
coroutineScope.launch(Dispatchers.IO) {
try {
val host = Uri.parse(url).host ?: return@launch
val results = dnsLookupManager.lookup(host)
Log.d("DNS", "gitlab.intrusion.com resolved to: ${results?.firstOrNull()?.address}") val resolvedIp = results?.firstOrNull()?.address?.hostAddress val interceptInfo = extractServiceInterceptInfo(service.config) val port = Uri.parse(url).port.takeIf { it != -1 } ?: if (url.startsWith("https")) 443 else 80 val allowedPorts = interceptInfo?.ports ?: emptyList() val portInIntercept = allowedPorts.any { (low, high) -> port in low..high } if (isIpInZitiSubnet(resolvedIp) && portInIntercept) { val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) intent.resolveActivity(context.packageManager)?.let { context.startActivity(intent) } ?: withContext(Dispatchers.Main) { Toast.makeText(context, "No browser found to open $url", Toast.LENGTH_SHORT).show() } } else { withContext(Dispatchers.Main) { Toast.makeText(context, "Ziti not intercepting $host:$port", Toast.LENGTH_SHORT).show() } } } catch (e: Exception) { withContext(Dispatchers.Main) { Toast.makeText(context, "Failed to resolve/open $url", Toast.LENGTH_SHORT).show() } Log.e("Ziti-DNS", "Error resolving $url", e) } } }