parse real client IP
This commit is contained in:
@@ -106,6 +106,13 @@ func (c *limitConn) Metadata() metadata.Metadata {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *limitConn) ClientAddr() net.Addr {
|
||||
if sc, ok := c.Conn.(xnet.ClientAddr); ok {
|
||||
return sc.ClientAddr()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type packetConn struct {
|
||||
net.PacketConn
|
||||
limiter traffic.TrafficLimiter
|
||||
|
||||
Reference in New Issue
Block a user