webrtc: add NAT1To1IPs []string to Config for multi-IP support (issue #20)
This commit is contained in:
parent
10eaaff6b7
commit
57542a3d80
1 changed files with 11 additions and 0 deletions
|
|
@ -17,8 +17,18 @@ type Config struct {
|
||||||
|
|
||||||
// PublicIP is the server's externally-reachable IP, advertised in ICE
|
// PublicIP is the server's externally-reachable IP, advertised in ICE
|
||||||
// candidates via NAT1To1. Empty means rely on STUN discovery.
|
// candidates via NAT1To1. Empty means rely on STUN discovery.
|
||||||
|
// Deprecated in favour of NAT1To1IPs for multi-homed servers; when both
|
||||||
|
// are set, PublicIP is treated as the first entry in NAT1To1IPs.
|
||||||
PublicIP string
|
PublicIP string
|
||||||
|
|
||||||
|
// NAT1To1IPs is the list of NAT1To1 IPs for ICE host candidates.
|
||||||
|
// When non-empty, Pion advertises a host candidate for each IP so that
|
||||||
|
// peers can reach this server through NAT on any of the listed addresses.
|
||||||
|
// Takes precedence over PublicIP when set; PublicIP is treated as a member
|
||||||
|
// of this list when both are configured. Typical use: dual-homed servers
|
||||||
|
// with both a LAN IP and a public IP.
|
||||||
|
NAT1To1IPs []string
|
||||||
|
|
||||||
// UDPPortRange bounds the local UDP ports allocated for FFmpeg→Pion RTP.
|
// UDPPortRange bounds the local UDP ports allocated for FFmpeg→Pion RTP.
|
||||||
UDPPortRange PortRange
|
UDPPortRange PortRange
|
||||||
|
|
||||||
|
|
@ -35,6 +45,7 @@ func DefaultConfig() Config {
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
WHEPListen: ":8787",
|
WHEPListen: ":8787",
|
||||||
PublicIP: "",
|
PublicIP: "",
|
||||||
|
NAT1To1IPs: nil,
|
||||||
UDPPortRange: PortRange{Low: 10000, High: 10100},
|
UDPPortRange: PortRange{Low: 10000, High: 10100},
|
||||||
ICEServers: []string{"stun:stun.cloudflare.com:3478", "stun:stun.l.google.com:19302"},
|
ICEServers: []string{"stun:stun.cloudflare.com:3478", "stun:stun.l.google.com:19302"},
|
||||||
MaxPeersTotal: 32,
|
MaxPeersTotal: 32,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue