mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-10 13:48:47 +00:00
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user