From 6b048e3e998261a4bc105593e27607cf9d56e223 Mon Sep 17 00:00:00 2001 From: Bluesaxorcist Date: Sat, 14 Sep 2019 18:56:03 -0500 Subject: refactoring the modes --- modes/stun_udp/stun_udp.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'modes/stun_udp') diff --git a/modes/stun_udp/stun_udp.go b/modes/stun_udp/stun_udp.go index f12e69e..564e562 100644 --- a/modes/stun_udp/stun_udp.go +++ b/modes/stun_udp/stun_udp.go @@ -31,8 +31,10 @@ package stun_udp import ( "fmt" + options2 "github.com/OperatorFoundation/shapeshifter-dispatcher/common" "github.com/OperatorFoundation/shapeshifter-dispatcher/common/pt_extras" "github.com/OperatorFoundation/shapeshifter-transports/transports/Dust" + replicant "github.com/OperatorFoundation/shapeshifter-transports/transports/Replicant" "github.com/OperatorFoundation/shapeshifter-transports/transports/meeklite" "github.com/OperatorFoundation/shapeshifter-transports/transports/shadow" "io" @@ -166,7 +168,7 @@ func dialConn(tracker *ConnTracker, addr string, target string, name string, opt fmt.Println("Dialing....") - args, argsErr := pt.ParsePT2ClientParameters(options) + args, argsErr := options2.ParseOptions(options) if argsErr != nil { log.Errorf("Error parsing transport options: %s", options) return @@ -243,14 +245,14 @@ func ServerSetup(termMon *termmon.TermMonitor, bindaddrString string, ptServerIn log.Errorf("meeklite transport missing Front argument: %s", args) return } - //case "replicant": - // if config, ok := args["config"]; ok { - // transport := replicant.New(config[0]) - // listen = transport.Listen - // } else { - // log.Errorf("replicant transport missing config argument: %s", args) - // return - // } + case "replicant": + if _, ok := args["config"]; ok { + transport := replicant.New(replicant.Config{}) + listen = transport.Listen + } else { + log.Errorf("replicant transport missing config argument: %s", args) + return + } case "Dust": if idPath, ok := args["idPath"]; ok { transport := Dust.NewDustServer(idPath[0]) -- cgit v1.2.3