Revert "ICE servers as URIs with auth."

This commit is contained in:
Miroslav Šedivý 2021-03-15 17:15:58 +01:00
parent fd07597262
commit c8328a56c0

View File

@ -3,7 +3,6 @@ package webrtc
import (
"fmt"
"io"
"net/url"
"strings"
"sync"
"time"
@ -424,35 +423,6 @@ func (manager *WebRTCManagerCtx) apiConfiguration() *webrtc.Configuration {
}
}
ICEServers := []webrtc.ICEServer{}
for _, server := range manager.config.ICEServers {
u, err := url.Parse(server)
// if it is not valid URL, just pass it down
if err != nil {
ICEServers = append(ICEServers, webrtc.ICEServer{
URLs: []string{server},
})
continue
}
var pwdInt interface{}
pwd, ok := u.User.Password()
if ok {
pwdInt = pwd
} else {
pwdInt = false
}
ICEServers = append(ICEServers, webrtc.ICEServer{
URLs: []string{
u.Scheme + ":" + u.Host + u.Path + "?" + u.RawQuery,
},
Username: u.User.Username(),
Credential: pwdInt,
})
}
return &webrtc.Configuration{
ICEServers: []webrtc.ICEServer{
{