diff options
author | Bluesaxorcist <joshua@operatorfoundation.org> | 2019-09-14 18:56:03 -0500 |
---|---|---|
committer | Bluesaxorcist <joshua@operatorfoundation.org> | 2019-09-14 18:56:03 -0500 |
commit | 6b048e3e998261a4bc105593e27607cf9d56e223 (patch) | |
tree | 713da1e089cfb861da8646ab96239be10c099800 /modes/stun_udp | |
parent | bfc867e0f07555b906ab7f3673aa3f6946a83bf9 (diff) |
refactoring the modes
Diffstat (limited to 'modes/stun_udp')
-rw-r--r-- | modes/stun_udp/stun_udp.go | 20 |
1 files changed, 11 insertions, 9 deletions
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]) |