Documentation
¶
Index ¶
- Variables
- func GetExternalIP(ctx context.Context, stunServers []string, localAddr net.Addr) (string, error)
- func GetLocalIPAddresses(includeLoopback bool, preferredInterfaces []string) ([]string, error)
- func IPFilterFromConf(ips IPsConfig) (func(ip net.IP) bool, error)
- func InterfaceFilterFromConf(ifs InterfacesConfig) func(string) bool
- type BatchIOConfig
- type IPsConfig
- type InterfacesConfig
- type PortRange
- type RTCConfig
- type WebRTCConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultStunServers = []string{
"global.stun.twilio.com:3478",
"stun.l.google.com:19302",
"stun1.l.google.com:19302",
}
Functions ¶
func GetExternalIP ¶
GetExternalIP return external IP for localAddr from stun server. If localAddr is nil, a local address is chosen automatically, else the address will be used to validate the external IP is accessible from the outside.
func GetLocalIPAddresses ¶
func InterfaceFilterFromConf ¶
func InterfaceFilterFromConf(ifs InterfacesConfig) func(string) bool
Types ¶
type BatchIOConfig ¶
type InterfacesConfig ¶
type RTCConfig ¶
type RTCConfig struct {
UDPPort PortRange `yaml:"udp_port,omitempty"`
TCPPort uint32 `yaml:"tcp_port,omitempty"`
ICEPortRangeStart uint32 `yaml:"port_range_start,omitempty"`
ICEPortRangeEnd uint32 `yaml:"port_range_end,omitempty"`
UseStunPortAsICE bool `yaml:"use_stun_port_as_ice,omitempty"`
NodeIP string `yaml:"node_ip,omitempty"`
NodeIPAutoGenerated bool `yaml:"-"`
STUNServers []string `yaml:"stun_servers,omitempty"`
UseExternalIP bool `yaml:"use_external_ip"`
UseICELite bool `yaml:"use_ice_lite,omitempty"`
Interfaces InterfacesConfig `yaml:"interfaces,omitempty"`
IPs IPsConfig `yaml:"ips,omitempty"`
EnableLoopbackCandidate bool `yaml:"enable_loopback_candidate"`
UseMDNS bool `yaml:"use_mdns,omitempty"`
// when UseExternalIP is true, only advertise the external IP to client
ExternalIPOnly bool `yaml:"external_ip_only,omitempty"`
BatchIO BatchIOConfig `yaml:"batch_io,omitempty"`
// SCTP congestion control
SCTPMinCwnd int `yaml:"sctp_min_cwnd,omitempty"`
SCTPFastRtxWnd int `yaml:"sctp_fast_rtx_wnd,omitempty"`
SCTPCwndCAStep int `yaml:"sctp_cwnd_ca_step,omitempty"`
// for testing, disable UDP
ForceTCP bool `yaml:"force_tcp,omitempty"`
}
type WebRTCConfig ¶
type WebRTCConfig struct {
Configuration webrtc.Configuration
SettingEngine webrtc.SettingEngine
UDPMux ice.UDPMux
TCPMuxListener *net.TCPListener
NAT1To1IPs []string
UseMDNS bool
}
func NewWebRTCConfig ¶
func NewWebRTCConfig(rtcConf *RTCConfig, development bool) (*WebRTCConfig, error)
Click to show internal directories.
Click to hide internal directories.