[tor-commits] [snowflake/master] multiple arbitrary ice servers can be passed as client flag (close #24)

serene at torproject.org serene at torproject.org
Tue Mar 8 07:05:38 UTC 2016


commit 9daa6c4b71bf4a366aa65a65f1551b8febd7a1df
Author: Serene Han <keroserene+git at gmail.com>
Date:   Sat Mar 5 17:01:30 2016 -0800

    multiple arbitrary ice servers can be passed as client flag (close #24)
---
 client/snowflake.go | 10 +++++-----
 client/torrc        |  2 +-
 client/util.go      |  2 ++
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/client/snowflake.go b/client/snowflake.go
index 4287425..f10c50e 100644
--- a/client/snowflake.go
+++ b/client/snowflake.go
@@ -64,7 +64,6 @@ func dialWebRTC() (*webRTCConn, error) {
 	// TODO: [#3] Fetch ICE server information from Broker.
 	// TODO: [#18] Consider TURN servers here too.
 	config := webrtc.NewConfiguration(iceServers...)
-
 	broker := NewBrokerChannel(brokerURL, frontDomain)
 	if nil == broker {
 		return nil, errors.New("Failed to prepare BrokerChannel")
@@ -160,10 +159,6 @@ func readSignalingMessages(f *os.File) {
 func main() {
 	// var err error
 	webrtc.SetLoggingVerbosity(1)
-	flag.StringVar(&brokerURL, "url", "", "URL of signaling broker")
-	flag.StringVar(&frontDomain, "front", "", "front domain")
-	flag.Var(&iceServers, "ice", "comma-separated list of ICE servers")
-	flag.Parse()
 	logFile, err := os.OpenFile("snowflake.log", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600)
 	if err != nil {
 		log.Fatal(err)
@@ -172,6 +167,11 @@ func main() {
 	log.SetOutput(logFile)
 	log.Println("\nStarting Snowflake Client...")
 
+	flag.StringVar(&brokerURL, "url", "", "URL of signaling broker")
+	flag.StringVar(&frontDomain, "front", "", "front domain")
+	flag.Var(&iceServers, "ice", "comma-separated list of ICE servers")
+	flag.Parse()
+
 	// Expect user to copy-paste if
 	// TODO: Maybe just get rid of copy-paste entirely.
 	if "" != brokerURL {
diff --git a/client/torrc b/client/torrc
index c4af61f..b6d0f61 100644
--- a/client/torrc
+++ b/client/torrc
@@ -4,6 +4,6 @@ DataDirectory datadir
 ClientTransportPlugin snowflake exec ./client \
 -url https://snowflake-reg.appspot.com/ \
 -front www.google.com \
--ice stun:stun.l.google.com:19302
+-ice stun:stun.l.google.com:19302,stun:s1.taraba.net
 
 Bridge snowflake 0.0.3.0:1
diff --git a/client/util.go b/client/util.go
index 02132f2..6a2b6de 100644
--- a/client/util.go
+++ b/client/util.go
@@ -19,8 +19,10 @@ func (i *IceServerList) String() string {
 }
 
 func (i *IceServerList) Set(s string) error {
+	log.Println("IceServerList:")
 	for _, server := range strings.Split(s, ",") {
 		// TODO: STUN / TURN url format validation?
+		log.Println(server)
 		option := webrtc.OptionIceServer(server)
 		*i = append(*i, option)
 	}





More information about the tor-commits mailing list