Open hcaihao opened 8 years ago
such as php does:
$db = new IP2LocationDatabase( 'db/IP2LOCATION-LITE-DB11.BIN', IP2LocationDatabase::FILE_IO); $your_public_ip = '8.8.8.8'; $records = $db->lookup($your_public_ip, IP2LocationDatabase::ALL); ...
did you mean get location by ip address through nginx config script?
No, I have many ip addresses to query, I need get infos form lua code.
local ips = {"ip1", "ip2", "ip3"};
for k, v in ipairs(ips) do get_country(ips[k]) get_city(ips[k]) ... end
How to implement get_country & get_city function?
hi @hcaihao, sorry for the delay. can you show me your nginx config and lua script. i just do not know how to reproduce this.
IP write in code, not by user request.