From d61f12f46a20c4ed6cc56c267ab8ebe937477349 Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Mon, 26 Apr 2021 20:42:17 +0800 Subject: [PATCH] Style: code style --- Makefile | 3 ++- proxy/redir/{tcp_windows.go => tcp_other.go} | 4 +++- proxy/redir/tproxy.go | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) rename proxy/redir/{tcp_windows.go => tcp_other.go} (63%) diff --git a/Makefile b/Makefile index 29de198c..68651446 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,8 @@ PLATFORM_LIST = \ linux-mips64 \ linux-mips64le \ freebsd-386 \ - freebsd-amd64 + freebsd-amd64 \ + freebsd-arm64 WINDOWS_ARCH_LIST = \ windows-386 \ diff --git a/proxy/redir/tcp_windows.go b/proxy/redir/tcp_other.go similarity index 63% rename from proxy/redir/tcp_windows.go rename to proxy/redir/tcp_other.go index 58b3e912..21743ec0 100644 --- a/proxy/redir/tcp_windows.go +++ b/proxy/redir/tcp_other.go @@ -1,3 +1,5 @@ +// +build !darwin,!linux,!freebsd + package redir import ( @@ -8,5 +10,5 @@ import ( ) func parserPacket(conn net.Conn) (socks5.Addr, error) { - return nil, errors.New("Windows not support yet") + return nil, errors.New("system not support yet") } diff --git a/proxy/redir/tproxy.go b/proxy/redir/tproxy.go index 27c7b56d..e2846e4f 100644 --- a/proxy/redir/tproxy.go +++ b/proxy/redir/tproxy.go @@ -48,7 +48,7 @@ func NewTProxy(addr string) (*TProxyListener, error) { } continue } - go rl.handleRedir(c) + go rl.handleTProxy(c) } }() @@ -64,7 +64,7 @@ func (l *TProxyListener) Address() string { return l.address } -func (l *TProxyListener) handleRedir(conn net.Conn) { +func (l *TProxyListener) handleTProxy(conn net.Conn) { target := socks5.ParseAddrToSocksAddr(conn.LocalAddr()) conn.(*net.TCPConn).SetKeepAlive(true) tunnel.Add(inbound.NewSocket(target, conn, C.TPROXY))