diff options
-rw-r--r-- | modes/pt_socks5/pt_socks5.go | 6 | ||||
-rw-r--r-- | modes/stun_udp/stun_udp.go | 6 | ||||
-rw-r--r-- | modes/transparent_tcp/transparent_tcp.go | 6 | ||||
-rw-r--r-- | modes/transparent_udp/transparent_udp.go | 6 | ||||
-rw-r--r-- | shapeshifter-dispatcher/shapeshifter-dispatcher.go | 12 |
5 files changed, 11 insertions, 25 deletions
diff --git a/modes/pt_socks5/pt_socks5.go b/modes/pt_socks5/pt_socks5.go index 9243f31..0a82971 100644 --- a/modes/pt_socks5/pt_socks5.go +++ b/modes/pt_socks5/pt_socks5.go @@ -46,13 +46,9 @@ import ( "github.com/OperatorFoundation/shapeshifter-transports/transports/obfs4" ) -const ( - socksAddr = "127.0.0.1:0" -) - var stateDir string -func ClientSetup(termMon *termmon.TermMonitor, target string, ptClientProxy *url.URL, names []string, options string) (launched bool, listeners []net.Listener) { +func ClientSetup(termMon *termmon.TermMonitor, socksAddr string, target string, ptClientProxy *url.URL, names []string, options string) (launched bool, listeners []net.Listener) { // Launch each of the client listeners. for _, name := range names { ln, err := net.Listen("tcp", socksAddr) diff --git a/modes/stun_udp/stun_udp.go b/modes/stun_udp/stun_udp.go index 81ef6d8..535e9b9 100644 --- a/modes/stun_udp/stun_udp.go +++ b/modes/stun_udp/stun_udp.go @@ -51,10 +51,6 @@ import ( "github.com/OperatorFoundation/shapeshifter-transports/transports/obfs4" ) -const ( - socksAddr = "127.0.0.1:1234" -) - var stateDir string type ConnState struct { @@ -68,7 +64,7 @@ func NewConnState() ConnState { type ConnTracker map[string]ConnState -func ClientSetup(termMon *termmon.TermMonitor, target string, ptClientProxy *url.URL, names []string, options string) bool { +func ClientSetup(termMon *termmon.TermMonitor, socksAddr string, target string, ptClientProxy *url.URL, names []string, options string) bool { // Launch each of the client listeners. for _, name := range names { udpAddr, err := net.ResolveUDPAddr("udp", socksAddr) diff --git a/modes/transparent_tcp/transparent_tcp.go b/modes/transparent_tcp/transparent_tcp.go index 17cd5d4..0e06869 100644 --- a/modes/transparent_tcp/transparent_tcp.go +++ b/modes/transparent_tcp/transparent_tcp.go @@ -48,13 +48,9 @@ import ( "github.com/OperatorFoundation/shapeshifter-transports/transports/shadow" ) -const ( - socksAddr = "127.0.0.1:1234" -) - var stateDir string -func ClientSetup(termMon *termmon.TermMonitor, target string, ptClientProxy *url.URL, names []string, options string) (launched bool, listeners []net.Listener) { +func ClientSetup(termMon *termmon.TermMonitor, socksAddr string, target string, ptClientProxy *url.URL, names []string, options string) (launched bool, listeners []net.Listener) { // Launch each of the client listeners. for _, name := range names { ln, err := net.Listen("tcp", socksAddr) diff --git a/modes/transparent_udp/transparent_udp.go b/modes/transparent_udp/transparent_udp.go index 63591a7..4be013a 100644 --- a/modes/transparent_udp/transparent_udp.go +++ b/modes/transparent_udp/transparent_udp.go @@ -49,10 +49,6 @@ import ( "github.com/OperatorFoundation/shapeshifter-transports/transports/obfs4" ) -const ( - socksAddr = "127.0.0.1:1234" -) - var stateDir string type ConnState struct { @@ -66,7 +62,7 @@ func NewConnState() ConnState { type ConnTracker map[string]ConnState -func ClientSetup(termMon *termmon.TermMonitor, target string, ptClientProxy *url.URL, names []string, options string) bool { +func ClientSetup(termMon *termmon.TermMonitor, socksAddr string, target string, ptClientProxy *url.URL, names []string, options string) bool { // Launch each of the client listeners. for _, name := range names { udpAddr, err := net.ResolveUDPAddr("udp", socksAddr) diff --git a/shapeshifter-dispatcher/shapeshifter-dispatcher.go b/shapeshifter-dispatcher/shapeshifter-dispatcher.go index de85e8d..de30b97 100644 --- a/shapeshifter-dispatcher/shapeshifter-dispatcher.go +++ b/shapeshifter-dispatcher/shapeshifter-dispatcher.go @@ -60,7 +60,6 @@ import ( const ( dispatcherVersion = "0.0.7-dev" dispatcherLogFile = "dispatcher.log" - socksAddr = "127.0.0.1:0" ) var stateDir string @@ -101,6 +100,9 @@ func main() { extorport := flag.String("extorport", "", "Specify the address of a server implementing the Extended OR Port protocol, which is used for per-connection metadata") authcookie := flag.String("authcookie", "", "Specify an authentication cookie, for use in authenticating with the Extended OR Port") + // Experimental flags under consideration for PT 2.1 + socksAddr := flag.String("proxylistenaddr", "127.0.0.1:0", "Specify the bind address for the local SOCKS server provided by the client") + // Additional command line flags inherited from obfs4proxy showVer := flag.Bool("version", false, "Print version and exit") logLevelStr := flag.String("logLevel", "ERROR", "Log level (ERROR/WARN/INFO/DEBUG)") @@ -158,7 +160,7 @@ func main() { } else { ptClientProxy, names := getClientNames(ptversion, transportsList, proxy) - launched = transparent_udp.ClientSetup(termMon, *target, ptClientProxy, names, *options) + launched = transparent_udp.ClientSetup(termMon, *socksAddr, *target, ptClientProxy, names, *options) } } else { log.Infof("%s - initializing server transport listeners", execName) @@ -180,7 +182,7 @@ func main() { } else { ptClientProxy, names := getClientNames(ptversion, transportsList, proxy) - launched, clientListeners = transparent_tcp.ClientSetup(termMon, *target, ptClientProxy, names, *options) + launched, clientListeners = transparent_tcp.ClientSetup(termMon, *socksAddr, *target, ptClientProxy, names, *options) } } else { log.Infof("%s - initializing server transport listeners", execName) @@ -202,7 +204,7 @@ func main() { } else { ptClientProxy, names := getClientNames(ptversion, transportsList, proxy) - launched = stun_udp.ClientSetup(termMon, *target, ptClientProxy, names, *options) + launched = stun_udp.ClientSetup(termMon, *socksAddr, *target, ptClientProxy, names, *options) } } else { log.Infof("%s - initializing server transport listeners", execName) @@ -220,7 +222,7 @@ func main() { log.Infof("%s - initializing client transport listeners", execName) ptClientProxy, names := getClientNames(ptversion, transportsList, proxy) - launched, clientListeners = pt_socks5.ClientSetup(termMon, *target, ptClientProxy, names, *options) + launched, clientListeners = pt_socks5.ClientSetup(termMon, *socksAddr, *target, ptClientProxy, names, *options) } else { log.Infof("%s - initializing server transport listeners", execName) ptServerInfo := getServerInfo(ptversion, bindAddr, options, transportsList, orport, extorport, authcookie) |