Giter VIP home page Giter VIP logo

nodejs-geoip2ws's People

Contributors

dependabot[bot] avatar fvdm avatar greenkeeper[bot] avatar greenkeeperio-bot 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nodejs-geoip2ws's Issues

Passing parameters on call (Feature request)

Hi,

There are cases in which the parameters are not known from the beginning and are taken after querying a database. In this case, it would be more convenient if the parameters were passed later as an options object during the call and not on declaration through require.

Tia

Replace httpreq with xfetch

httpreq does not implement either debug or HTTP_PROXY. Therefore, it is makes extremely tedious to debug an issue with geoip2ws.

I am just getting an error "API Error" without ability to either proxy the query to see whats going on or get additional debug information.

I am happy to raise a PR if you are open for a change.

How do you get around CORS not supported by Maxmind endpoint?

Sorry that Issue Tracker isn't the proper way to ask this but maybe you do know why this request gets trashed by CORS.

$.ajax({ method: "GET", url: "https://geoip.maxmind.com/geoip/v2.1/city/176.100.200.195", crossDomain: true, dataType: 'application/json', headers: { "Authorization": "Basic " + btoa("13234234" + ":" + "theapikey") }, success: function (data) { db[ip] = {lat: data.location.latitude, lng: data.location.latitude}; resolve(); }, error: function (jqXHR, t, eT) { console.error("request failed for ", t, jqXHR); }

unfortuately my browser answers with:
Access to XMLHttpRequest at 'https://geoip.maxmind.com/geoip/v2.1/city/176.187.201.195' from origin 'https://myurl.eu' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Even though I set my domain in https://www.maxmind.com/en/accounts/current/geoip/javascript/domains so it should be allowed.

I know this is a very raw request not using your node libary, I come from backend and this CORS thing is pretty new to me.

Trying to Get state name

"subdivisions" throws an error(s)

var insights = new require ('geoip2ws') (userId, licenseKey, 'insights');
insights ('111.111.111.111', myCallback);

data.subdivisions.iso_code = undefined
data.subdivisions = [object Object]
data.subdivisions.names = undefined
data.subdivisions.names.en = Can't read property 'en'

Am I doing this incorrectly?

CORS issue

Hi,
I've been using geoip2ws for some time. It's been working great. Since October I found it having issue with cors. I don't know if something's changed in Maxmind services or it's geoip2ws causing the trouble. Now I'm using version 1.8.9. All popular browsers affected. Console output below:

Failed to load https://geoip.maxmind.com/geoip/v2.1/country/me: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://solcdn-a.akamaihd.net' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Of course domain solcdn-a.akamaihd.net has been added in Maxmind
Any help appreciated!

An in-range update of dotest is breaking the build 🚨


🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! πŸ’œ πŸššπŸ’¨ πŸ’š

Find out how to migrate to Snyk at greenkeeper.io


The devDependency dotest was updated from 2.6.2 to 2.7.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

dotest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • βœ… coverage/coveralls: First build on greenkeeper/dotest-2.7.0 at 96.479% (Details).

Commits

The new version differs by 9 commits.

  • ce306a3 2.7.0
  • 13ee536 Docs(changelog): Update changelog
  • f2e1fe4 Test(config): Add OS to Travis config
  • a49d391 Test(config): Update Travis node versions
  • 2209dab Test(config): Modernized Travis config
  • 06ccbcc Breaking: Removed Codacy support
  • 3900870 Chore(package): Minimum node version 10
  • d1f58db Chore(package): Update dependencies
  • 7002580 Chore(dev): Update editorconfig

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Module not found:

I installed the package as you said, but I missing these dependencies. I'm using webpack.

Module not found: Error: Can't resolve 'net' in '.../node_modules/geoip2ws'
Module not found: Error: Can't resolve 'fs' in '.../node_modules/httpreq/lib'

buffer encoding issue

hey franklin, found an encoding issue and but couldn't track it down to fix it.

using the 'city' api, and searching for "24.114.81.3", it gums-up the json somewhere near the utf8 characters.

tried manually setting the buffer encoding, and tried
data.toString('utf8').trim() without the dash, but neither worked.
just a heads-up
cheers
-spence

Client side usage

Hi,

I'm trying to setup a client side call to the maxmind API using a browserify based build. Being unfamiliar with the Maxmind api, I was wondering if there is a way to call use this module to call their service without knowing one's ip address, as you can with the client side library.

I'm trying not to have to insert their script as a global, since it will complicate our build process.

thanks kindly!

Keep Alive Option

When making large amount of Maxmind calls, it would be nice to reuse the previously opened connections instead of having to reopen them each time. This helps speed up the requests and also limits the amount of sockets opened when making requests.

Would it be possible to include an option for KeepAlive? Or just in general the various http agent settings:

https://nodejs.org/api/http.html#http_new_agent_options

"userId" type

Hi,

Please clarify the type of userId.

In all examples it is entered as integer, but in the "functions" table the type is string.

Tia

PS: Yes, I am aware about string <--> integer (number) conversions.

An in-range update of dotest is breaking the build 🚨

The devDependency dotest was updated from 2.5.0 to 2.6.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

dotest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 12 commits.

  • e8d3095 2.6.0
  • 85f85d9 Docs(changelog): Update changelog
  • 330083e Refactor: Replaced istanbul with nyc
  • 0bcf073 Chore(package): Update dependencies
  • f138e11 Chore(package): Update minimum node version
  • d48e381 Docs: Minor clean up
  • 2892933 Test: Improve coverage for error() and fail()
  • 786d1ca Feat: Add log() dontCount argument
  • 0fb58f7 Test(config): Update Travis node versions
  • 57bfb71 Test(config): Update ESLint ES version to 2017
  • 9a4401d chore(package): update eslint to version 5.15.2 (#30)
  • 667f55d Fix(runner): Incorrect Codacy env check

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

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.