diff --git a/vlib/net/tcp.c.v b/vlib/net/tcp.c.v index 3a265ef1ed70e3..da957d6aa4b1fe 100644 --- a/vlib/net/tcp.c.v +++ b/vlib/net/tcp.c.v @@ -297,7 +297,7 @@ pub fn (c &TcpConn) peer_addr() !Addr { // peer_ip retrieves the ip address used by the peer, and returns it as a string pub fn (c &TcpConn) peer_ip() !string { - return c.peer_addr()!.str() + return c.peer_addr()!.str().all_before(':') } pub fn (c &TcpConn) addr() !Addr {