diff options
author | Brandon Wiley <brandon@blanu.net> | 2016-11-16 15:10:16 -0600 |
---|---|---|
committer | Brandon Wiley <brandon@blanu.net> | 2016-11-16 15:10:16 -0600 |
commit | fc4bf82171d7337c9db1ce91e553a3b9a97beb02 (patch) | |
tree | dbc39637fe5888e010b9cfd02536fd46add147e4 /modes/transparent_tcp | |
parent | c1d70905378fefa781172e9e9b314a816765c32a (diff) |
Added new command line flags and refactored ClientSetup to use them
Diffstat (limited to 'modes/transparent_tcp')
-rw-r--r-- | modes/transparent_tcp/transparent_tcp.go | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/modes/transparent_tcp/transparent_tcp.go b/modes/transparent_tcp/transparent_tcp.go index 30e04fc..119e797 100644 --- a/modes/transparent_tcp/transparent_tcp.go +++ b/modes/transparent_tcp/transparent_tcp.go @@ -49,31 +49,14 @@ import ( ) const ( - obfs4proxyVersion = "0.0.7-dev" - obfs4proxyLogFile = "obfs4proxy.log" - socksAddr = "127.0.0.1:1234" + socksAddr = "127.0.0.1:1234" ) var stateDir string -func ClientSetup(termMon *termmon.TermMonitor, target string) (launched bool, listeners []net.Listener) { - methodNames := [...]string{"obfs2"} - var ptClientProxy *url.URL = nil - +func ClientSetup(termMon *termmon.TermMonitor, target string, ptClientProxy *url.URL, factories map[string]base.ClientFactory) (launched bool, listeners []net.Listener) { // Launch each of the client listeners. - for _, name := range methodNames { - t := transports.Get(name) - if t == nil { - log.Errorf("no such transport is supported: %s", name) - continue - } - - f, err := t.ClientFactory(stateDir) - if err != nil { - log.Errorf("failed to get ClientFactory: %s", name) - continue - } - + for name, f := range factories { fmt.Println("Listening ", socksAddr) ln, err := net.Listen("tcp", socksAddr) if err != nil { |