diff options
author | Bluesaxorcist <joshua@operatorfoundation.org> | 2019-08-08 17:50:48 -0500 |
---|---|---|
committer | Bluesaxorcist <joshua@operatorfoundation.org> | 2019-08-08 17:50:48 -0500 |
commit | fa1b158cc47e7f5d8958823ac51504c41a4b440e (patch) | |
tree | d9a3023a2a91b4a8df3459af21dc6f7f0e71ece0 /modes | |
parent | 6b70945cc913e80abc432640aad2aa1e7330f76f (diff) |
Modified dialer to return conn and error
Diffstat (limited to 'modes')
-rw-r--r-- | modes/pt_socks5/pt_socks5.go | 4 | ||||
-rw-r--r-- | modes/stun_udp/stun_udp.go | 4 | ||||
-rw-r--r-- | modes/transparent_udp/transparent_udp.go | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/modes/pt_socks5/pt_socks5.go b/modes/pt_socks5/pt_socks5.go index 067a036..14b55e1 100644 --- a/modes/pt_socks5/pt_socks5.go +++ b/modes/pt_socks5/pt_socks5.go @@ -107,7 +107,7 @@ func clientHandler(target string, termMon *termmon.TermMonitor, name string, con } } - var dialer func(address string) net.Conn + var dialer func(address string) (net.Conn, error) // Deal with arguments. switch name { @@ -160,7 +160,7 @@ func clientHandler(target string, termMon *termmon.TermMonitor, name string, con f := dialer - remote := f(socksReq.Target) + remote, _ := f(socksReq.Target) if err != nil { log.Errorf("%s(%s) - outgoing connection failed: %s", name, addrStr, log.ElideError(err)) socksReq.Reply(socks5.ErrorToReplyCode(err)) diff --git a/modes/stun_udp/stun_udp.go b/modes/stun_udp/stun_udp.go index e80526b..7f0cdea 100644 --- a/modes/stun_udp/stun_udp.go +++ b/modes/stun_udp/stun_udp.go @@ -168,7 +168,7 @@ func dialConn(tracker *ConnTracker, addr string, target string, name string, opt return } - var f func(address string) net.Conn + var f func(address string) (net.Conn, error) // Deal with arguments. switch name { @@ -200,7 +200,7 @@ func dialConn(tracker *ConnTracker, addr string, target string, name string, opt } fmt.Println("Dialing ", target) - remote := f(target) + remote, _ := f(target) // if err != nil { // fmt.Println("outgoing connection failed", err) // log.Errorf("(%s) - outgoing connection failed: %s", target, log.ElideError(err)) diff --git a/modes/transparent_udp/transparent_udp.go b/modes/transparent_udp/transparent_udp.go index 9cceb82..6e573c2 100644 --- a/modes/transparent_udp/transparent_udp.go +++ b/modes/transparent_udp/transparent_udp.go @@ -173,7 +173,7 @@ func dialConn(tracker *ConnTracker, addr string, target string, name string, opt fmt.Println("Dialing....") - var dialer func(address string) net.Conn + var dialer func(address string) (net.Conn, error) args, argsErr := pt.ParsePT2ClientParameters(options) if argsErr != nil { @@ -212,7 +212,7 @@ func dialConn(tracker *ConnTracker, addr string, target string, name string, opt f := dialer fmt.Println("Dialing ", target) - remote := f(target) + remote, _ := f(target) // if err != nil { // fmt.Println("outgoing connection failed", err) // log.Errorf("(%s) - outgoing connection failed: %s", target, log.ElideError(err)) |