mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-03-06 22:29:55 +00:00
fix: IN-PORT not work in tproxy tcp inbound
https://github.com/MetaCubeX/mihomo/issues/1162
This commit is contained in:
@@ -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...))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user