Update helper.go

This commit is contained in:
tsightler
2023-01-13 17:33:49 -05:00
parent 4ae733aa11
commit 5e0f010885
+6 -1
View File
@@ -25,12 +25,17 @@ func NewCandidate(network, address string) (string, error) {
return "", err return "", err
} }
tcpType := ice.TCPTypeUnspecified
if network == "tcp" {
tcpType = ice.TCPTypePassive
}
cand, err := ice.NewCandidateHost(&ice.CandidateHostConfig{ cand, err := ice.NewCandidateHost(&ice.CandidateHostConfig{
Network: network, Network: network,
Address: host, Address: host,
Port: i, Port: i,
Component: ice.ComponentRTP, Component: ice.ComponentRTP,
TCPType: ice.TCPTypePassive, TCPType: tcpType,
}) })
if err != nil { if err != nil {
return "", err return "", err