update call routing to return ipv6 ips in RFC3986 format

This commit is contained in:
adel-signal authored and GitHub committed 2024-02-23 11:57:58 -05:00
1 parent a5774bf6ff
commit 665a26d164
2 files changed
+33 -29

No files matched your search

@@ -134,7 +134,11 @@ public class TurnCallRouter {
ipv4Selection = ipv4Selection.stream().limit(limit - ipv6Selection.size()).toList();
}
return Stream.concat(ipv4Selection.stream(), ipv6Selection.stream()).map(InetAddress::getHostAddress).toList();
return Stream.concat(
ipv4Selection.stream().map(InetAddress::getHostAddress),
// map ipv6 to RFC3986 format i.e. surrounded by brackets
ipv6Selection.stream().map(i -> String.format("[%s]", i.getHostAddress()))
).toList();
}
private static List<String> getUrlsForInstances(List<String> instanceIps) {