fix(telemost): exclude TURN/TURNS URLs from server hello config

This commit is contained in:
zarazaex69
2026-04-30 00:58:25 +03:00
parent 3e64c1f3cb
commit 3064850f7c

View File

@@ -698,12 +698,16 @@ func (p *Peer) applyServerHelloConfig(serverHello map[string]interface{}) {
switch rawURLs := server["urls"].(type) {
case []interface{}:
for _, rawURL := range rawURLs {
if url, ok := rawURL.(string); ok && url != "" {
if url, ok := rawURL.(string); ok && url != "" && !strings.HasPrefix(url, "turn:") && !strings.HasPrefix(url, "turns:") {
urls = append(urls, url)
}
}
case []string:
urls = append(urls, rawURLs...)
for _, url := range rawURLs {
if !strings.HasPrefix(url, "turn:") && !strings.HasPrefix(url, "turns:") {
urls = append(urls, url)
}
}
}
if len(urls) == 0 {