parse real client IP

This commit is contained in:
ginuerzh
2025-07-15 19:59:10 +08:00
parent d9a2f44a78
commit afcf4a5252
24 changed files with 232 additions and 74 deletions
+7
View File
@@ -80,6 +80,13 @@ func (c *serverConn) Metadata() metadata.Metadata {
return nil
}
func (c *serverConn) ClientAddr() net.Addr {
if sc, ok := c.Conn.(xnet.ClientAddr); ok {
return sc.ClientAddr()
}
return nil
}
type packetConn struct {
net.PacketConn
service string