Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Recommendations to do IP/Geo location on a website?
2 points by technics256 on April 2, 2020 | hide | past | favorite | 2 comments
I need to implement some geolocation system to limit visitors who can access a health website to two states (CA & NY).

What methods/services/libraries do you recommend to accomplish this?

Stack is Node/Express backend and React front end, if it matters.



For language dependent solution, https://www.npmjs.com/package/express-ipfilter looks alright.

You could try .htacesss or nginx proxy to block certain ip ranges for language agnostic solution.

https://www.maxmind.com/en/home provides ips mapped to location but I don't think you will find anything accurate for states.

Another would be to get location data from the client and send it to backend to decode and see if the user is in correct state. (Of course, someone could sniff that but people can already change their ips).


You could modify the example here - https://ipdata.co/blog/how-to-block-website-visitors-from-a-... to work with states easily enough.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: