mirror of https://github.com/XTLS/Xray-core
pull/4283/merge
parent
cced1477a0
commit
30e10be95d
|
@ -77,6 +77,8 @@ func (w *tcpWorker) callback(conn stat.Connection) {
|
||||||
case internet.SocketConfig_TProxy:
|
case internet.SocketConfig_TProxy:
|
||||||
dest = net.DestinationFromAddr(conn.LocalAddr())
|
dest = net.DestinationFromAddr(conn.LocalAddr())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if dest.IsValid() {
|
||||||
// Check if try to connect to this inbound itself (can cause loopback)
|
// Check if try to connect to this inbound itself (can cause loopback)
|
||||||
var isLoopBack bool
|
var isLoopBack bool
|
||||||
if w.address == net.AnyIP || w.address == net.AnyIPv6 {
|
if w.address == net.AnyIP || w.address == net.AnyIPv6 {
|
||||||
|
@ -94,8 +96,6 @@ func (w *tcpWorker) callback(conn stat.Connection) {
|
||||||
errors.LogError(ctx, errors.New("loopback connection detected"))
|
errors.LogError(ctx, errors.New("loopback connection detected"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if dest.IsValid() {
|
|
||||||
outbounds[0].Target = dest
|
outbounds[0].Target = dest
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue