mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-03 02:08:45 +00:00
Tunnel/Dokodemo: Fix stats conn unwrap (#5440)
Fixes https://github.com/XTLS/Xray-core/issues/5439
This commit is contained in:
@@ -32,3 +32,13 @@ func (c *CounterConnection) Write(b []byte) (int, error) {
|
||||
}
|
||||
return nBytes, err
|
||||
}
|
||||
|
||||
func TryUnwrapStatsConn(conn net.Conn) net.Conn {
|
||||
if conn == nil {
|
||||
return conn
|
||||
}
|
||||
if conn, ok := conn.(*CounterConnection); ok {
|
||||
return conn.Connection
|
||||
}
|
||||
return conn
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user