android: bind v4 server to real interface IP instead of 0.0.0.0

This commit is contained in:
evgeny committed 2026-08-12 19:17:37 +03:00
1 parent 0492b19468
commit ef115e0539
4 files changed
+31 -1

No files matched your search

@@ -307,7 +307,7 @@ class ConfigProvider(private val context: Context) {
for (srv in servers) {
val family = if (srv.bindIp.contains(":")) "v6" else "v4"
appendLine("[server:${srv.ifName}_$family]")
appendLine("addr=${if (family == "v6") "[::]" else "0.0.0.0"}:${srv.port}")
appendLine("addr=${if (family == "v6") "[::]" else srv.bindIp.ifBlank { "0.0.0.0" }}:${srv.port}")
appendLine("type=public")
appendLine("transport=${srv.protocol}")
if (family == "v6") appendLine("netif=${srv.ifName}")