2 ms·
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
by londons_explore 4y ago
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/8786d17e59c90aee2cb66db891d3a16c7f369ad7/src/torrent.cpp#L3496 https://github.com/arvidn/libtorrent/blob/8786d17e59c90aee2c...
- oefrha 4y agoWell, at least some clients use a geoip database, e.g. qBittorrent: https://github.com/qbittorrent/qBittorrent/blob/2ef059807afc4eee6e1a528d45cabfbdd12fcd2f/src/base/net/geoipmanager.cpp#L46 https://github.com/qbittorrent/qBittorrent/blob/2ef059807afc...