From 2047b8eda1c7a28e484ebe5361d28be75c9b6d75 Mon Sep 17 00:00:00 2001 From: Kr328 Date: Sat, 25 Apr 2020 00:39:30 +0800 Subject: [PATCH] Chore: remove unused parameter netType (#651) --- adapters/inbound/socket.go | 4 ++-- proxy/redir/tcp.go | 2 +- proxy/socks/tcp.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/adapters/inbound/socket.go b/adapters/inbound/socket.go index 43fbd0f5..134be489 100644 --- a/adapters/inbound/socket.go +++ b/adapters/inbound/socket.go @@ -19,9 +19,9 @@ func (s *SocketAdapter) Metadata() *C.Metadata { } // NewSocket is SocketAdapter generator -func NewSocket(target socks5.Addr, conn net.Conn, source C.Type, netType C.NetWork) *SocketAdapter { +func NewSocket(target socks5.Addr, conn net.Conn, source C.Type) *SocketAdapter { metadata := parseSocksAddr(target) - metadata.NetWork = netType + metadata.NetWork = C.TCP metadata.Type = source if ip, port, err := parseAddr(conn.RemoteAddr().String()); err == nil { metadata.SrcIP = ip diff --git a/proxy/redir/tcp.go b/proxy/redir/tcp.go index 58352198..e53d000d 100644 --- a/proxy/redir/tcp.go +++ b/proxy/redir/tcp.go @@ -55,5 +55,5 @@ func handleRedir(conn net.Conn) { return } conn.(*net.TCPConn).SetKeepAlive(true) - tunnel.Add(inbound.NewSocket(target, conn, C.REDIR, C.TCP)) + tunnel.Add(inbound.NewSocket(target, conn, C.REDIR)) } diff --git a/proxy/socks/tcp.go b/proxy/socks/tcp.go index eeff4bc4..50317177 100644 --- a/proxy/socks/tcp.go +++ b/proxy/socks/tcp.go @@ -64,5 +64,5 @@ func handleSocks(conn net.Conn) { io.Copy(ioutil.Discard, conn) return } - tunnel.Add(adapters.NewSocket(target, conn, C.SOCKS, C.TCP)) + tunnel.Add(adapters.NewSocket(target, conn, C.SOCKS)) }