mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 19:56:51 +08:00
fix: tracker remote addr check
This commit is contained in:
parent
9ba41f06c0
commit
d19543b259
|
@ -112,7 +112,7 @@ func (tt *tcpTracker) Upstream() any {
|
|||
|
||||
func NewTCPTracker(conn C.Conn, manager *Manager, metadata *C.Metadata, rule C.Rule, uploadTotal int64, downloadTotal int64, pushToManager bool) *tcpTracker {
|
||||
if conn != nil {
|
||||
if tcpAddr, ok := conn.RemoteAddr().(*net.TCPAddr); ok {
|
||||
if tcpAddr, ok := conn.RemoteAddr().(*net.TCPAddr); ok && tcpAddr.IP != nil {
|
||||
metadata.RemoteDst = tcpAddr.IP.String()
|
||||
} else {
|
||||
metadata.RemoteDst = conn.RemoteDestination()
|
||||
|
|
Loading…
Reference in New Issue
Block a user