mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-01 23:55:44 +02:00
Use proxy when any candidate is relay (#398)
We should use relayed port when remote or local candidate is of the relay type
This commit is contained in:
parent
86a66c6202
commit
2555a6c3e8
@ -288,6 +288,10 @@ func shouldUseProxy(pair *ice.CandidatePair) bool {
|
|||||||
remoteIsPublic := IsPublicIP(remoteIP)
|
remoteIsPublic := IsPublicIP(remoteIP)
|
||||||
myIsPublic := IsPublicIP(myIp)
|
myIsPublic := IsPublicIP(myIp)
|
||||||
|
|
||||||
|
if pair.Local.Type() == ice.CandidateTypeRelay || pair.Remote.Type() == ice.CandidateTypeRelay {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
//one of the hosts has a public IP
|
//one of the hosts has a public IP
|
||||||
if remoteIsPublic && pair.Remote.Type() == ice.CandidateTypeHost {
|
if remoteIsPublic && pair.Remote.Type() == ice.CandidateTypeHost {
|
||||||
return false
|
return false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user