问题
I know there are many online tool available but I want to write in house tool, references or how to go about it? Or even it can be done or is a mammoth task?
回答1:
You need to have a location database of all IP addresses. So, either you build a database yourself (a genuinely mammouth task) or you use an external service.
Some IP location services have have APIs so you can call then from your code.
来源:https://stackoverflow.com/questions/6006915/how-to-programmatically-find-geo-location-of-incoming-http-request