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
pull/5/head
Ayushya Chitransh 7 years ago committed by Ikmyeong Na
parent c07dca7be4
commit 2e5d3ac4e1
No known key found for this signature in database
GPG Key ID: EC674310ADADE2CA
  1. 3
      lib/node.js

@ -102,6 +102,9 @@ Node.prototype.setInfo = function(data, callback)
Node.prototype.setGeo = function(ip) Node.prototype.setGeo = function(ip)
{ {
if (ip.substr(0, 7) == "::ffff:") {
ip = ip.substr(7)
}
this.info.ip = ip; this.info.ip = ip;
this.geo = geoip.lookup(ip); this.geo = geoip.lookup(ip);
} }

Loading…
Cancel
Save