client multiplexes AND recovers correctly! (close #31)

- stabilize rest of WebRTCPeer
 - use uid for the datachannel label
 - store a consistent WebRTC config in the dialer
This commit is contained in:
Serene Han 2016-06-15 18:59:55 -07:00
parent 2bf0e5457e
commit e93c38f834
8 changed files with 50 additions and 35 deletions

View file

@ -75,7 +75,6 @@ func handler(socks SocksConnector, snowflakes SnowflakeCollector) error {
handlerChan <- -1
}()
// Obtain an available WebRTC remote. May block.
log.Println("handler: awaiting Snowflake...")
snowflake := snowflakes.Pop()
if nil == snowflake {
socks.Reject()
@ -148,6 +147,10 @@ func main() {
// Otherwise, use manual copy and pasting of SDP messages.
snowflakes.Tongue = NewCopyPasteDialer(iceServers)
}
if nil == snowflakes.Tongue {
log.Fatal("Unable to prepare rendezvous method.")
return
}
// Use a real logger to periodically output how much traffic is happening.
snowflakes.BytesLogger = &BytesSyncLogger{
inboundChan: make(chan int, 5), outboundChan: make(chan int, 5),
@ -212,4 +215,5 @@ func main() {
case sig = <-sigChan:
}
}
log.Println("snowflake is done.")
}