fvdm / nodejs-geoip2ws Goto Github PK
View Code? Open in Web Editor NEWMaxmind GeoIP2 Web Services for Node.js
Home Page: https://www.npmjs.com/package/geoip2ws
License: The Unlicense
Maxmind GeoIP2 Web Services for Node.js
Home Page: https://www.npmjs.com/package/geoip2ws
License: The Unlicense
"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?
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'
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!
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:
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.
It would be nice if this lib could load .mmdb files(Geolite2 free database)
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!
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.
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
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
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.
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
π¨ 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
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.
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
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
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
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.
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.