Archived
2
0

iceservers join with iceserver.

This commit is contained in:
m1k1o 2021-04-04 22:48:54 +02:00
parent f85d4d312f
commit 83570a15ca
2 changed files with 13 additions and 5 deletions

View File

@ -40,6 +40,7 @@ For n.eko room management software visit https://github.com/m1k1o/neko-rooms.
- Added simple language picker.
- Added `?usr=<display-name>` that will prefill username. This allows creating auto-join links.
- Added `?cast=1` that will hide all control and show only video.
- Support for password protected `NEKO_ICESERVERS` (by @mbattista).
### Bugs
- Fixed minor gst pipeline bug.
@ -282,7 +283,7 @@ NEKO_ICELITE:
- Use the ice lite protocol
- e.g. false
NEKO_ICESERVER:
- Describes a single STUN and TURN server that can be used by the ICEAgent to establish a connection with a peer (deprecated)
- Describes a single STUN and TURN server that can be used by the ICEAgent to establish a connection with a peer (simple usage for server without authentication)
- e.g. 'stun:stun.l.google.com:19302'
NEKO_ICESERVERS:
- Describes multiple STUN and TURN server that can be used by the ICEAgent to establish a connection with a peer

View File

@ -50,15 +50,22 @@ func (WebRTC) Init(cmd *cobra.Command) error {
}
func (s *WebRTC) Set() {
s.NAT1To1IPs = viper.GetStringSlice("nat1to1")
s.ICELite = viper.GetBool("icelite")
s.ICEServers = []webrtc.ICEServer{{URLs: viper.GetStringSlice("iceserver")}}
if viper.GetString("iceservers") != "" {
err := json.Unmarshal([]byte(viper.GetString("iceservers")), &s.ICEServers)
s.ICEServers = []webrtc.ICEServer{}
iceServersJson := viper.GetString("iceservers")
if iceServersJson != "" {
err := json.Unmarshal([]byte(iceServersJson), &s.ICEServers)
if err != nil {
panic(err)
}
}
s.NAT1To1IPs = viper.GetStringSlice("nat1to1")
iceServerSlice := viper.GetStringSlice("iceserver")
if len(iceServerSlice) > 0 {
s.ICEServers = append(s.ICEServers, webrtc.ICEServer{URLs: iceServerSlice})
}
if len(s.NAT1To1IPs) == 0 {
ip, err := utils.GetIP()