navinpeiris / geoip Goto Github PK
View Code? Open in Web Editor NEWElixir library to find geo location information given an IP address, hostname or Plug.Conn
License: MIT License
Elixir library to find geo location information given an IP address, hostname or Plug.Conn
License: MIT License
So I have my app behind an nginx proxy which means the real IP address is set via headers.
I can do you a quick pull request to %Pug.Conn{} match shortly to add this if said headers exist?
Ta.
geoip (version 0.1.2) requires ~> 0.9
mix.lock specifies 1.0.0
Hi guys,
There is any chance for given support for the ipstack url request?
I see that the current request is considers the structure of freegeoip:
curl *url*/json/*ip*
but now the request for ipstack is a little different:
curl http://api.ipstack.com/*ip*?access_key=*access_key*
Thanks
When I do GeoIP.lookup("2001:0db8:85a3:0000:0000:8a2e:0370:7334")
or any other example v6 address, I get empty results .
GeoIP.lookup
accepts IP addresses as strings or as Erlang IP address (for instance {204, 62, 14, 153}
and it is documented (for instance the example GeoIP.lookup({8,
8, 8, 8})` ). But it is true only for IPv4. IPv6 addresses are only accepted as strings.
iex(2)> GeoIP.lookup({204, 62, 14, 153})
{:ok,
%{
city: "New York City",
country: "US",
hostname: "ada.bortzmeyer.org",
ip: "204.62.14.153",
loc: "40.7143,-74.0060",
org: "AS46636 NatCoWeb Corp.",
postal: "10004",
readme: "https://ipinfo.io/missingauth",
region: "New York",
timezone: "America/New_York"
}}
iex(3)> GeoIP.lookup({8193, 19352, 3520, 65, 534, 16127, 65063, 15679})
{:error,
%GeoIP.Error{
id: nil,
reason: "{\n \"status\": 404,\n \"error\": {\n \"title\": \"Wrong ip\",\n \"message\": \"Please provide a valid IP address\"\n }\n}"
}}
The test suite apparently only tests with IPv4 addresses.
Hi,
I am the DevRel of IPinfo. We are very happy to be a part of this project; however, it is unfortunate that we do not natively provide hostname to IP address information and only accept IP addresses as input.
To resolve this issue, we would like to add Host.io's services to this project. Host.io provides detailed host-level information, including information on the hosting IP address. The information is quite extensive, and I recommend checking out the full schema from the documentation: https://host.io/docs#apifulldomain
However, regarding IP geolocation, we suggest using only the following API endpoint:
API request to the
/ipinfo
endpoint
curl https://host.io/api/ipinfo/example.com?token=$token
API response
{
"93.184.216.34": {
"city": "Dźwirzyno",
"region": "West Pomerania",
"country": "PL",
"loc": "54.1593,15.4112",
"postal": "78-100",
"timezone": "Europe/Warsaw",
"asn": {
"asn": "AS15133",
"name": "Edgecast Inc.",
"domain": "edg.io",
"route": "93.184.216.0/24",
"type": "hosting"
}
},
"2606:2800:220:1:248:1893:25c8:1946": {
"city": "Los Angeles",
"region": "California",
"country": "US",
"loc": "34.0522,-118.2437",
"postal": "90009",
"timezone": "America/Los_Angeles",
"asn": {
"asn": "AS15133",
"name": "Edgecast Inc.",
"domain": "edg.io",
"route": "2606:2800:220::/48",
"type": "hosting"
}
}
}
The API provides IP geolocation information of multiple IP addresses related to the hostname. The API also comes with a free tier.
Please, let me know what you think. I can submit a PR as soon as possible. Thank you for reviewing.
How about using the maxmind files directly, instead of freegeoip.net?
We would like to propose support for the IP2Location.io API. It has a free tier upon registration. It is one of the fastest API available in the market right now.
We can also offer PR if it is supported.
Distributed Caches is part of cachex 3.1 we should update and make cachex :nodes
option configurable
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.