From 610f55b478cbf4ba5e238ecd3bfa6cc35abf3088 Mon Sep 17 00:00:00 2001 From: fangdingjun Date: Fri, 20 Jan 2017 10:56:35 +0800 Subject: [PATCH] use socks.Client.Dial function --- obfssh_client/proxy.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/obfssh_client/proxy.go b/obfssh_client/proxy.go index 48cd288..adb5a80 100644 --- a/obfssh_client/proxy.go +++ b/obfssh_client/proxy.go @@ -153,9 +153,10 @@ func dialSocks5Proxy(host string, port int, p proxy) (net.Conn, error) { } c1 := &socks.Client{Conn: c} - if err = c1.Connect(host, uint16(port)); err != nil { + c2, err := c1.Dial("tcp", fmt.Sprintf("%s:%d", host, port)) + if err != nil { c1.Close() return nil, err } - return c1, err + return c2, err }