diff options
author | atanarjuat <atanarjuat@example.com> | 2022-05-23 01:36:21 +0200 |
---|---|---|
committer | atanarjuat <atanarjuat@example.com> | 2022-05-23 01:36:21 +0200 |
commit | e72ad4b857b09a788c553283ecb8cda7d2b580fd (patch) | |
tree | bf3a016793ca128b7a680166dc4fba181fc5d8a5 /client/main.go | |
parent | 3c127453800e95f0c76234c1f0f836375ed73b99 (diff) |
wip: kcp client
Diffstat (limited to 'client/main.go')
-rw-r--r-- | client/main.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/client/main.go b/client/main.go index 0c7edcc..daf6ce4 100644 --- a/client/main.go +++ b/client/main.go @@ -10,6 +10,8 @@ import ( "0xacab.org/leap/obfsvpn" socks5 "github.com/armon/go-socks5" + + "github.com/xtaci/kcp-go" ) func main() { @@ -49,6 +51,12 @@ func main() { logger.Fatalf("cannot get dialer: %v", err) } + if os.Getenv("KCP") == "1" { + dialer.DialFunc = func(network, address string) (net.Conn, error) { + return kcp.Dial(address) + } + } + socksConf := &socks5.Config{ Dial: dialer.Dial, } |