diff --git a/internal/websocket/client_commands.go b/internal/websocket/client_commands.go index b38e55b..60158f2 100644 --- a/internal/websocket/client_commands.go +++ b/internal/websocket/client_commands.go @@ -17,7 +17,7 @@ func handleClientCommands(c models.WebsocketClient) { _, message, err := ws.ReadMessage() if err != nil { - log.Info("Client disconnected:", "msg", err, "host", ws.NetConn().RemoteAddr(), "clients", len(Clients)-1) + log.Info("Client disconnected:", "msg", err, "host", ws.RemoteAddr(), "clients", len(Clients)-1) delete(Clients, ws.LocalAddr()) break } diff --git a/internal/websocket/handle_connection.go b/internal/websocket/handle_connection.go index b7b240f..6abb339 100644 --- a/internal/websocket/handle_connection.go +++ b/internal/websocket/handle_connection.go @@ -29,7 +29,7 @@ func HandleConnection(w http.ResponseWriter, r *http.Request) { } defer ws.Close() - log.Info("Client connected", "host", ws.NetConn().RemoteAddr(), "clients", len(Clients)+1) + log.Info("Client connected", "host", ws.RemoteAddr(), "clients", len(Clients)+1) // Register the new client client := models.WebsocketClient{