diff --git a/server/uptime-kuma-server.js b/server/uptime-kuma-server.js index b45a749b9..728b8f158 100644 --- a/server/uptime-kuma-server.js +++ b/server/uptime-kuma-server.js @@ -249,9 +249,9 @@ class UptimeKumaServer { return (typeof forwardedFor === "string" ? forwardedFor.split(",")[0].trim() : null) || socket.client.conn.request.headers["x-real-ip"] - || clientIP.replace(/^.*:/, ""); + || clientIP.replace(/^::ffff:/, ""); } else { - return clientIP.replace(/^.*:/, ""); + return clientIP.replace(/^::ffff:/, ""); } }