mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-02-23 05:23:14 +08:00
fix: IN-PORT not work in tproxy tcp inbound
https://github.com/MetaCubeX/mihomo/issues/1162
This commit is contained in:
parent
c893e3c462
commit
d1539e6c07
@ -34,6 +34,8 @@ func (l *Listener) Close() error {
|
|||||||
func (l *Listener) handleTProxy(conn net.Conn, tunnel C.Tunnel, additions ...inbound.Addition) {
|
func (l *Listener) handleTProxy(conn net.Conn, tunnel C.Tunnel, additions ...inbound.Addition) {
|
||||||
target := socks5.ParseAddrToSocksAddr(conn.LocalAddr())
|
target := socks5.ParseAddrToSocksAddr(conn.LocalAddr())
|
||||||
N.TCPKeepAlive(conn)
|
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...))
|
tunnel.HandleTCPConn(inbound.NewSocket(target, conn, C.TPROXY, additions...))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user