un33k / node-ipware

Returns the real IP address of users in Node.js
MIT License
124 stars 17 forks source link

Instead of a normal ip, a strange #14

Closed ghost closed 5 years ago

ghost commented 6 years ago

I could do without your package just by referring to the req variable and truncate the address with the slice (7) command. At you here such problem in a package: var getIP = require('ipware')().get_ip; const server = http.createServer((req, res) => { res.statusCode = 200; res.setHeader('Content-Type', 'text/html'); res.end('Hello\n'); fs.appendFileSync('ip', getIP(req).clientIp+'\n'); }); But then I saw this in the file: 127.0.0.1 ::ffff:77.160.120.90 That's getting in the way ::ffff:

un33k commented 5 years ago

@morteryler IPV6 encapsulation support for IPV4 is added in https://github.com/un33k/node-ipware/pull/16