mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-28 12:36:30 +00:00
Add optional lite ICE agent config param
This commit is contained in:
parent
589cda91f4
commit
f688f3c5f4
3 changed files with 8 additions and 0 deletions
|
|
@ -262,6 +262,10 @@ webrtc:
|
|||
# a list of STUN/TURN servers to use
|
||||
iceServers:
|
||||
- url: stun:stun.l.google.com:19302
|
||||
# configures whether the ice agent should be a lite agent (true/false)
|
||||
# (performance)
|
||||
# don't use iceServers when enabled
|
||||
iceLite: false
|
||||
# ICE configuration
|
||||
# by default, ICE ports are random and unlimited
|
||||
# alternatives:
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ type Webrtc struct {
|
|||
Max uint16
|
||||
}
|
||||
IceIpMap string
|
||||
IceLite bool
|
||||
SinglePort int
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@ func DefaultPeerConnection(conf conf.Webrtc) (*PeerConnection, error) {
|
|||
panic(err)
|
||||
}
|
||||
}
|
||||
if conf.IceLite {
|
||||
settingEngine.SetLite(conf.IceLite)
|
||||
}
|
||||
if conf.IcePorts.Min > 0 && conf.IcePorts.Max > 0 {
|
||||
if err := settingEngine.SetEphemeralUDPPortRange(conf.IcePorts.Min, conf.IcePorts.Max); err != nil {
|
||||
panic(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue