-
Notifications
You must be signed in to change notification settings - Fork 19
Geo Ip Plugin
The Geo Ip plugin is a simple Plugin module which allows websites to retrieve Geo Ip data in the form of Country and City, Region.
At present there are two individual sources, they are:
- WebNet77 data.
- IpStack data.
Each external service has it's own implementation and may or may not require you to download or register for services, should you choose that implementation.
The Geo Ip plugin can be configured using appsettings.json. Add an entry called GeoIpPluginConfiguration, this has the following settings:
Enum, this value can be None or IpStack.
String, path to IpToCountry.csv for country data only, obtained from http://software77.net/geo-ip/.
This property has one sub property called ApiKey which can be obtained from https://ipstack.com/.
String, Api key obtained by registering with IpStack.
There are plans to include other Geo Ip providers in the future, if you want one integrated create an issue and get involved or create an issue which someone else can pick up and implement.
If you provide the path/file name for IpToCountry.csv in the settings, this will be loaded into memory when the plugin is started, this allows for a very fast lookup of country only, based on a range of Ip addresses. If you then choose IpStack on top, each range will only be searched once when required, this can involve a small delay as IpStack is a web based service. Once data has been retrieved for a range, any Ip address within the range will not require a future lookup.