mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
prepare IceServerList client flag (#24)
This commit is contained in:
parent
d2e61e315c
commit
3ec771df01
2 changed files with 19 additions and 0 deletions
|
@ -1,7 +1,9 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -9,6 +11,20 @@ const (
|
|||
LogTimeInterval = 5
|
||||
)
|
||||
|
||||
type IceServerList []string
|
||||
|
||||
func (i *IceServerList) String() string {
|
||||
return fmt.Sprint(*i)
|
||||
}
|
||||
|
||||
func (i *IceServerList) Set(s string) error {
|
||||
for _, server := range strings.Split(s, ",") {
|
||||
// TODO: STUN / TURN url format validation?
|
||||
*i = append(*i, server)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type BytesInfo struct {
|
||||
outboundChan chan int
|
||||
inboundChan chan int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue