Giter Site home page Giter Site logo

geoip's People

Contributors

bortzmeyer avatar dependabot[bot] avatar iloveitaly avatar ip2location avatar kelostrada avatar kianmeng avatar navinpeiris avatar s3cur3 avatar syamilmj avatar versilov avatar warmwaffles avatar zubairshokh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

geoip's Issues

ipstack support

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

Difference of behaviour between IPv4 and IPv6

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.

Feature Request: Hostname to IP Geolocation using host.io from IPinfo

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.

Support X-Forwarded-For or X-Real-IP

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.

Doesn't Support IPv6

When I do GeoIP.lookup("2001:0db8:85a3:0000:0000:8a2e:0370:7334") or any other example v6 address, I get empty results .

Suggestion: Support IP2Location.io API

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.