sindresorhus / public-ip

Get your public IP address - very fast!
MIT License
1.02k stars 65 forks source link

returning a constant ip & ipv6 not returning data showing query time out #31

Closed harshitsinghwap closed 5 years ago

harshitsinghwap commented 5 years ago

hello , my site is running on a cloud "goorm.io" and they use aws services. your tool/library not working. each time its returning a constant ip (54.180.139.241) if you figure out or trace the ip (54.180.139.241) its showing aws ip's not showing the client ip. i dont know what is causing the error ? does it require any depedencies ? if not then i suggest you to fix this error

sindresorhus commented 5 years ago

You are not understanding how this module works.

harshitsinghwap commented 5 years ago

lol i think you actully dont knw how this works ! or what iam doing wrong i will be glad if you explain me in short and i have seen someone raised the same issue, its returning the server ip insted of user ip. for your refrence iam posting my code below

const publicIp = require('public-ip'); app.get("/",function(req,res){ res.send("You triggred our server!!"); (async () => { console.log(await publicIp.v4()); //=> '46.5.21.123' console.log(await publicIp.v6()); //=> 'fe80::200:f8ff:fe21:67cf' })();