mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
provide IceServerList flag as variadic arg to webrtc Configuration (#24)
This commit is contained in:
parent
3ec771df01
commit
4e6bba559a
3 changed files with 7 additions and 5 deletions
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/keroserene/go-webrtc"
|
||||
"log"
|
||||
"strings"
|
||||
"time"
|
||||
|
@ -11,7 +12,7 @@ const (
|
|||
LogTimeInterval = 5
|
||||
)
|
||||
|
||||
type IceServerList []string
|
||||
type IceServerList []webrtc.ConfigurationOption
|
||||
|
||||
func (i *IceServerList) String() string {
|
||||
return fmt.Sprint(*i)
|
||||
|
@ -20,7 +21,8 @@ func (i *IceServerList) String() string {
|
|||
func (i *IceServerList) Set(s string) error {
|
||||
for _, server := range strings.Split(s, ",") {
|
||||
// TODO: STUN / TURN url format validation?
|
||||
*i = append(*i, server)
|
||||
option := webrtc.OptionIceServer(server)
|
||||
*i = append(*i, option)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue