Style: code style

This commit is contained in:
Dreamacro 2021-04-26 20:42:17 +08:00
parent 16a6d409d9
commit 682e65cb54
3 changed files with 7 additions and 4 deletions

View file

@ -22,7 +22,8 @@ PLATFORM_LIST = \
linux-mips64 \ linux-mips64 \
linux-mips64le \ linux-mips64le \
freebsd-386 \ freebsd-386 \
freebsd-amd64 freebsd-amd64 \
freebsd-arm64
WINDOWS_ARCH_LIST = \ WINDOWS_ARCH_LIST = \
windows-386 \ windows-386 \

View file

@ -1,3 +1,5 @@
// +build !darwin,!linux,!freebsd
package redir package redir
import ( import (
@ -8,5 +10,5 @@ import (
) )
func parserPacket(conn net.Conn) (socks5.Addr, error) { func parserPacket(conn net.Conn) (socks5.Addr, error) {
return nil, errors.New("Windows not support yet") return nil, errors.New("system not support yet")
} }

View file

@ -48,7 +48,7 @@ func NewTProxy(addr string) (*TProxyListener, error) {
} }
continue continue
} }
go rl.handleRedir(c) go rl.handleTProxy(c)
} }
}() }()
@ -64,7 +64,7 @@ func (l *TProxyListener) Address() string {
return l.address return l.address
} }
func (l *TProxyListener) handleRedir(conn net.Conn) { func (l *TProxyListener) handleTProxy(conn net.Conn) {
target := socks5.ParseAddrToSocksAddr(conn.LocalAddr()) target := socks5.ParseAddrToSocksAddr(conn.LocalAddr())
conn.(*net.TCPConn).SetKeepAlive(true) conn.(*net.TCPConn).SetKeepAlive(true)
tunnel.Add(inbound.NewSocket(target, conn, C.TPROXY)) tunnel.Add(inbound.NewSocket(target, conn, C.TPROXY))