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:
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: