Hacker News new | past | comments | ask | show | jobs | submit login

Country is normally determined by doing a reverse DNS lookup, and then looking at the country code in the domain name. It's not very accurate, but you can do it for free without relying on any third party service or database.

Here is the libtorrent code that does it for every peer:

https://github.com/arvidn/libtorrent/blob/8786d17e59c90aee2c...




Well, at least some clients use a geoip database, e.g. qBittorrent: https://github.com/qbittorrent/qBittorrent/blob/2ef059807afc...




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: