mirror of
https://github.com/pion/webrtc.git
synced 2025-10-04 14:53:05 +08:00
Add InterfaceFilter to SettingEngine
This allows users to filter interfaces from ICE gathering Resolves #843 Co-authored-by: Sean DuBois <sean@siobud.com>
This commit is contained in:

committed by
Sean DuBois

parent
d8b7905aaf
commit
cabbd8b52f
@@ -33,6 +33,7 @@ type SettingEngine struct {
|
||||
ICELite bool
|
||||
ICETrickle bool
|
||||
ICENetworkTypes []NetworkType
|
||||
InterfaceFilter func(string) bool
|
||||
}
|
||||
LoggerFactory logging.LoggerFactory
|
||||
}
|
||||
@@ -105,3 +106,11 @@ func (e *SettingEngine) SetTrickle(trickle bool) {
|
||||
func (e *SettingEngine) SetNetworkTypes(candidateTypes []NetworkType) {
|
||||
e.candidates.ICENetworkTypes = candidateTypes
|
||||
}
|
||||
|
||||
// SetInterfaceFilter sets the filtering functions when gathering ICE candidates
|
||||
// This can be used to exclude certain network interfaces from ICE. Which may be
|
||||
// useful if you know a certain interface will never succeed, or if you wish to reduce
|
||||
// the amount of information you wish to expose to the remote peer
|
||||
func (e *SettingEngine) SetInterfaceFilter(filter func(string) bool) {
|
||||
e.candidates.InterfaceFilter = filter
|
||||
}
|
||||
|
Reference in New Issue
Block a user