From 40e80bf196804942f8473aa9cd619913d6620f75 Mon Sep 17 00:00:00 2001 From: Kim Gert Nielsen Date: Tue, 19 Nov 2024 11:37:57 +0100 Subject: [PATCH] Expose underlying LocalAddr() When using multiple IPs its sometime nice to know which IP the client connected to. Signed-off-by: Kim Nielsen --- go/mysql/conn.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/go/mysql/conn.go b/go/mysql/conn.go index d4f870e660f..0c0c0096cd6 100644 --- a/go/mysql/conn.go +++ b/go/mysql/conn.go @@ -730,6 +730,11 @@ func (c *Conn) RemoteAddr() net.Addr { return c.conn.RemoteAddr() } +// LocalAddr returns the underlying socket LocalAddr(). +func (c *Conn) LocalAddr() net.Addr { + return c.conn.LocalAddr() +} + // ID returns the MySQL connection ID for this connection. func (c *Conn) ID() int64 { return int64(c.ConnectionID)