From 2e5d3ac4e19c79040ff068ef03d8091681e21c17 Mon Sep 17 00:00:00 2001 From: Ayushya Chitransh Date: Tue, 13 Feb 2018 14:52:45 +0530 Subject: [PATCH] Using corrected IP address IP address being received had `:ffff` at the starting, it needs to be corrected before setting correct IP for node. Closes #99 --- lib/node.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/node.js b/lib/node.js index 8e4f9ca..454fa54 100644 --- a/lib/node.js +++ b/lib/node.js @@ -102,6 +102,9 @@ Node.prototype.setInfo = function(data, callback) Node.prototype.setGeo = function(ip) { + if (ip.substr(0, 7) == "::ffff:") { + ip = ip.substr(7) + } this.info.ip = ip; this.geo = geoip.lookup(ip); }