Skip to content

Commit

Permalink
add additionalHosts
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Jun 10, 2024
1 parent 952fbe0 commit 3bbc7c1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions icegatherer.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func (g *ICEGatherer) createAgent() error {
IPFilter: g.api.settingEngine.candidates.IPFilter,
NAT1To1IPs: g.api.settingEngine.candidates.NAT1To1IPs,
NAT1To1IPCandidateType: nat1To1CandiTyp,
AdditionalHosts: g.api.settingEngine.candidates.AdditionalHosts,
IncludeLoopback: g.api.settingEngine.candidates.IncludeLoopbackCandidate,
Net: g.api.settingEngine.net,
MulticastDNSMode: mDNSMode,
Expand All @@ -120,6 +121,7 @@ func (g *ICEGatherer) createAgent() error {
LocalPwd: g.api.settingEngine.candidates.Password,
TCPMux: g.api.settingEngine.iceTCPMux,
UDPMux: g.api.settingEngine.iceUDPMux,
UDPRandom: g.api.settingEngine.iceUDPRandom,
ProxyDialer: g.api.settingEngine.iceProxyDialer,
DisableActiveTCP: g.api.settingEngine.iceDisableActiveTCP,
BindingRequestHandler: g.api.settingEngine.iceBindingRequestHandler,
Expand Down
10 changes: 10 additions & 0 deletions settingengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type SettingEngine struct {
IPFilter func(net.IP) bool
NAT1To1IPs []string
NAT1To1IPCandidateType ICECandidateType
AdditionalHosts []string
MulticastDNSMode ice.MulticastDNSMode
MulticastDNSHostName string
UsernameFragment string
Expand Down Expand Up @@ -88,6 +89,7 @@ type SettingEngine struct {
LoggerFactory logging.LoggerFactory
iceTCPMux ice.TCPMux
iceUDPMux ice.UDPMux
iceUDPRandom bool
iceProxyDialer proxy.Dialer
iceDisableActiveTCP bool
iceBindingRequestHandler func(m *stun.Message, local, remote ice.Candidate, pair *ice.CandidatePair) bool
Expand Down Expand Up @@ -230,6 +232,10 @@ func (e *SettingEngine) SetNAT1To1IPs(ips []string, candidateType ICECandidateTy
e.candidates.NAT1To1IPCandidateType = candidateType
}

func (e *SettingEngine) SetAdditionalHosts(hosts []string) {
e.candidates.AdditionalHosts = hosts
}

// SetIncludeLoopbackCandidate enable pion to gather loopback candidates, it is useful
// for some VM have public IP mapped to loopback interface
func (e *SettingEngine) SetIncludeLoopbackCandidate(include bool) {
Expand Down Expand Up @@ -348,6 +354,10 @@ func (e *SettingEngine) SetICEUDPMux(udpMux ice.UDPMux) {
e.iceUDPMux = udpMux
}

func (e *SettingEngine) SetICEUDPRandom(v bool) {
e.iceUDPRandom = v
}

// SetICEProxyDialer sets the proxy dialer interface based on golang.org/x/net/proxy.
func (e *SettingEngine) SetICEProxyDialer(d proxy.Dialer) {
e.iceProxyDialer = d
Expand Down

0 comments on commit 3bbc7c1

Please sign in to comment.