We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
您是否查看过 node.js 模块页面?
它列出了 GeoIP 和 node-geoip 和 node-maxmind 和 node-maxmind-native。
Have you looked at the node.js modules page?
It lists GeoIP and node-geoip and node-maxmind and node-maxmind-native.
我发现 node-maxmind 是功能最齐全且易于使用的模块。您需要从maxmind 下载页面下载文件,然后就可以使用它像这样:
使用模块的另一种方法是使用地理定位 API,该模块通常需要安装地理定位数据库并定期更新它。我自己就有这样一项服务,http://ipinfo.io。下面是使用优秀的请求模块调用它的示例:
有关更多详细信息,请参阅 http://ipinfo.io/developers 。
I've found the node-maxmind to be the most feature complete and easy to use module. You need to download the files from the maxmind download page, and then you can use it like this:
An alternative to using a module, which usually requires you to install a geolocation database and regularly update it, is to use a geolocation API. One such service is my own, http://ipinfo.io. Here's an example of calling that using the excellent request module:
See http://ipinfo.io/developers for more details.