mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Move ICE server logging out of parseIceServers.
This commit is contained in:
parent
509f634506
commit
aa3999857f
1 changed files with 4 additions and 3 deletions
|
@ -69,16 +69,13 @@ func socksAcceptLoop(ln *pt.SocksListener, snowflakes sf.SnowflakeCollector) {
|
||||||
// s is a comma-separated list of ICE server URLs.
|
// s is a comma-separated list of ICE server URLs.
|
||||||
func parseIceServers(s string) []webrtc.ICEServer {
|
func parseIceServers(s string) []webrtc.ICEServer {
|
||||||
var servers []webrtc.ICEServer
|
var servers []webrtc.ICEServer
|
||||||
log.Println(s)
|
|
||||||
s = strings.TrimSpace(s)
|
s = strings.TrimSpace(s)
|
||||||
if len(s) == 0 {
|
if len(s) == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
urls := strings.Split(s, ",")
|
urls := strings.Split(s, ",")
|
||||||
log.Printf("Using ICE Servers:")
|
|
||||||
for _, url := range urls {
|
for _, url := range urls {
|
||||||
url = strings.TrimSpace(url)
|
url = strings.TrimSpace(url)
|
||||||
log.Printf("url: %s", url)
|
|
||||||
servers = append(servers, webrtc.ICEServer{
|
servers = append(servers, webrtc.ICEServer{
|
||||||
URLs: []string{url},
|
URLs: []string{url},
|
||||||
})
|
})
|
||||||
|
@ -126,6 +123,10 @@ func main() {
|
||||||
log.Println("\n\n\n --- Starting Snowflake Client ---")
|
log.Println("\n\n\n --- Starting Snowflake Client ---")
|
||||||
|
|
||||||
iceServers := parseIceServers(*iceServersCommas)
|
iceServers := parseIceServers(*iceServersCommas)
|
||||||
|
log.Printf("Using ICE servers:")
|
||||||
|
for _, server := range iceServers {
|
||||||
|
log.Printf("url: %v", strings.Join(server.URLs, " "))
|
||||||
|
}
|
||||||
|
|
||||||
// Prepare to collect remote WebRTC peers.
|
// Prepare to collect remote WebRTC peers.
|
||||||
snowflakes := sf.NewPeers(*max)
|
snowflakes := sf.NewPeers(*max)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue