Coder Social home page Coder Social logo

Comments (6)

Loyalsoldier avatar Loyalsoldier commented on June 11, 2024

目前没有这个打算。你可以借助本项目,构建自己的数据库文件,参考本项目 README。

from geoip.

MaurUppi avatar MaurUppi commented on June 11, 2024

目前没有这个打算。你可以借助本项目,构建自己的数据库文件,参考本项目 README。

虽然Issue closed
但,可否询问一下,当前项目程序是否同样支持 db-ip的CSV或者mmdb呢?

https://db-ip.com/db/download/ip-to-country-lite

image

from geoip.

Loyalsoldier avatar Loyalsoldier commented on June 11, 2024

支持 MaxMind 的 MMDB 格式作为输入端(input)

from geoip.

MaurUppi avatar MaurUppi commented on June 11, 2024

支持 MaxMind 的 MMDB 格式作为输入端(input)

我看到 plugin/maxmind/mmdb_in.go 有用到 github.com/oschwald/maxminddb-golang 库,这个是库是可以支持读取db-IP mmdb的。

另外config.json只有 maxmindGeoLite2CountryCSV ,mmdb格式是否更改为 maxmindGeoLite2CountryMMDB还是怎样?

    {
      "type": "maxmindGeoLite2CountryCSV",
      "action": "add",
      "args": {
        "country": "./geolite2/GeoLite2-Country-Locations-en.csv",
        "ipv4": "./geolite2/GeoLite2-Country-Blocks-IPv4.csv",
        "ipv6": "./geolite2/GeoLite2-Country-Blocks-IPv6.csv"
      }
    }
import (
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"os"
	"path/filepath"
	"strings"

	"github.com/Loyalsoldier/geoip/lib"
	"github.com/oschwald/maxminddb-golang"
)

from geoip.

Loyalsoldier avatar Loyalsoldier commented on June 11, 2024

配置参考:

{
"type": "maxmindMMDB",
"action": "add"
},
{
"type": "maxmindMMDB",
"action": "add",
"args": {
"uri": "./path/to/your/mmdb/file",
"wantedList": ["cn", "us"],
"onlyIPType": "ipv4"
}
},
{
"type": "maxmindMMDB",
"action": "add",
"args": {
"uri": "https://raw.githubusercontent.com/Loyalsoldier/geoip/release/Country.mmdb"
}
},
{
"type": "maxmindMMDB",
"action": "remove",
"args": {
"uri": "https://raw.githubusercontent.com/Loyalsoldier/geoip/release/Country.mmdb",
"wantedList": ["jp"],
"onlyIPType": "ipv6"
}
},

from geoip.

JohnnySun avatar JohnnySun commented on June 11, 2024

@MaurUppi 我这边有一份替换maxmind数据库为ipinfo.io 数据库的commit修改 你可以拿去用,准确度比maxmind的数据准确很多

JohnnySun@b4f6f9b

from geoip.

Related Issues (20)

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.