diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/main.go | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/client/main.go b/client/main.go index 80ebb35..5cdfa4f 100644 --- a/client/main.go +++ b/client/main.go @@ -9,7 +9,7 @@ import ( "os" "0xacab.org/leap/obfsvpn" - socks5 "github.com/armon/go-socks5" + "0xacab.org/leap/obfsvpn/socks5" "github.com/xtaci/kcp-go" ) @@ -52,25 +52,24 @@ func main() { } // TODO make this configurable via a Config struct - // TODO make sure we're disabling the crypto options for KCP + // TODO make sure we're disabling all the crypto options for KCP if os.Getenv("KCP") == "1" { dialer.DialFunc = func(network, address string) (net.Conn, error) { + log.Printf("Dialing kcp://%s\n", address) return kcp.Dial(address) } } - socksConf := &socks5.Config{ - Dial: dialer.Dial, - } + addr := net.JoinHostPort(socksHost, socksPort) - server, err := socks5.New(socksConf) - if err != nil { - panic(err) + server := &socks5.Server{ + Addr: addr, + BindIP: "127.0.0.1", + Dial: dialer.Dial, } - addr := net.JoinHostPort(socksHost, socksPort) - fmt.Printf("[+] Started socks5 proxy at %s\n", addr) - if err := server.ListenAndServe("tcp", addr); err != nil { + fmt.Printf("[+] Starting socks5 proxy at %s\n", addr) + if err := server.ListenAndServe(); err != nil { panic(err) } } |