diff --git a/client/client_test.go b/client/client_test.go index aeaf979699e9022232c6e225a649fadff299797f..84e9cc166a01ad14ea98094f067f64bc76b850e5 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -49,8 +49,8 @@ func TestICEServerParser(t *testing.T) { So(len(servers), ShouldEqual, test.length) - for i, server := range servers { - So(server.URLs, ShouldResemble, test.urls[i]) + for _, server := range servers { + So(test.urls, ShouldContain, server.URLs) } } diff --git a/client/snowflake.go b/client/snowflake.go index 02bbf1e44db070121a812e502d449512f882dc52..55bc48e47cfeae51146128d681546a039022cd59 100644 --- a/client/snowflake.go +++ b/client/snowflake.go @@ -6,6 +6,7 @@ import ( "io" "io/ioutil" "log" + "math/rand" "net" "os" "os/signal" @@ -144,6 +145,14 @@ func main() { log.Println("\n\n\n --- Starting Snowflake Client ---") iceServers := parseIceServers(*iceServersCommas) + // chooses a random subset of servers from inputs + rand.Seed(time.Now().UnixNano()) + rand.Shuffle(len(iceServers), func(i, j int) { + iceServers[i], iceServers[j] = iceServers[j], iceServers[i] + }) + if len(iceServers) > 2 { + iceServers = iceServers[:(len(iceServers)+1)/2] + } log.Printf("Using ICE servers:") for _, server := range iceServers { log.Printf("url: %v", strings.Join(server.URLs, " ")) diff --git a/client/torrc b/client/torrc index 9e3946e85db7f4e533bacdaffe838310513617dd..813d22d3d5594d4aabbf4959dcd37ab1aa5ac282 100644 --- a/client/torrc +++ b/client/torrc @@ -4,7 +4,7 @@ DataDirectory datadir ClientTransportPlugin snowflake exec ./client \ -url https://snowflake-broker.azureedge.net/ \ -front ajax.aspnetcdn.com \ --ice stun:stun.l.google.com:19302 \ +-ice stun:stun.voip.blackberry.com:3478,stun:stun.altar.com.pl:3478,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.com:3478,stun:stun.sonetel.net:3478,stun:stun.stunprotocol.org:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478 \ -max 3 Bridge snowflake 192.0.2.3:1