summaryrefslogtreecommitdiff
path: root/modes
diff options
context:
space:
mode:
authorBrandon Wiley <brandon@blanu.net>2016-11-07 22:16:44 -0600
committerBrandon Wiley <brandon@blanu.net>2016-11-07 22:16:44 -0600
commit17f2cb99c26454c519ca23185ee5dd3176a9363d (patch)
treeda276750acd30164a12145f3d9eac42b5ace990d /modes
parentc0b8b261008d7d284ce30cd48cbd9a95cd6739ee (diff)
Updated to use no goturn API
Diffstat (limited to 'modes')
-rw-r--r--modes/stun_udp/stun_udp.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/modes/stun_udp/stun_udp.go b/modes/stun_udp/stun_udp.go
index 52872c3..7eda988 100644
--- a/modes/stun_udp/stun_udp.go
+++ b/modes/stun_udp/stun_udp.go
@@ -40,6 +40,8 @@ import (
"golang.org/x/net/proxy"
+ common "github.com/willscott/goturn/common"
+
"github.com/willscott/goturn"
"git.torproject.org/pluggable-transports/goptlib.git"
@@ -326,7 +328,7 @@ func serverAcceptLoop(termMon *termmon.TermMonitor, f base.ServerFactory, ln net
}
func serverHandler(termMon *termmon.TermMonitor, f base.ServerFactory, conn net.Conn, target string) {
- var header *turn.StunHeader
+ var header *common.Message
defer conn.Close()
termMon.OnHandlerStart()
@@ -375,8 +377,11 @@ func serverHandler(termMon *termmon.TermMonitor, f base.ServerFactory, conn net.
break
}
- header=&turn.StunHeader{}
- header.Decode(headerBuffer)
+ header, err = goturn.ParseStun(headerBuffer)
+ if err != nil {
+ fmt.Println("parse error")
+ break
+ }
fmt.Println(header.Length)