Skip to content

Commit

Permalink
fix: IN-PORT not work in tproxy tcp inbound
Browse files Browse the repository at this point in the history
  • Loading branch information
wwqgtxx committed Apr 4, 2024
1 parent c893e3c commit d1539e6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions listener/tproxy/tproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ func (l *Listener) Close() error {
func (l *Listener) handleTProxy(conn net.Conn, tunnel C.Tunnel, additions ...inbound.Addition) {
target := socks5.ParseAddrToSocksAddr(conn.LocalAddr())
N.TCPKeepAlive(conn)
// TProxy's conn.LocalAddr() is target address, so we set from l.listener
additions = append([]inbound.Addition{inbound.WithInAddr(l.listener.Addr())}, additions...)
tunnel.HandleTCPConn(inbound.NewSocket(target, conn, C.TPROXY, additions...))
}

Expand Down

0 comments on commit d1539e6

Please sign in to comment.