m666m / geoip

GeoIP for V2Ray. Generate geoip.dat for V2Ray automatically every Wednesday.

Home Page:https://www.v2fly.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GeoIP List for V2Ray

Automatically weekly release of geoip.dat for V2Ray.

Download links

Usage example

"routing": {
  "rules": [
    {
      "type": "field",
      "outboundTag": "Direct",
      "ip": [
        "223.5.5.5/32",
        "119.29.29.29/32",
        "180.76.76.76/32",
        "114.114.114.114/32",
        "geoip:cn",
        "geoip:private",
        "ext:cn.dat:cn",
        "ext:private.dat:private",
        "ext:geoip-only-cn-private.dat:cn",
        "ext:geoip-only-cn-private.dat:private"
      ]
    },
    {
      "type": "field",
      "outboundTag": "Proxy-1",
      "ip": [
        "1.1.1.1/32",
        "1.0.0.1/32",
        "8.8.8.8/32",
        "8.8.4.4/32"
      ]
    },
    {
      "type": "field",
      "outboundTag": "Proxy-2",
      "ip": [
        "geoip:us",
        "geoip:ca"
      ]
    },
    {
      "type": "field",
      "outboundTag": "Proxy-3",
      "ip": [
        "geoip:hk",
        "geoip:mo",
        "geoip:tw",
        "geoip:jp",
        "geoip:sg"
      ]
    }
  ]
}

Generate geoip.dat manually

  • Install golang and git
  • Clone project code: git clone https://github.com/v2fly/geoip.git
  • Download GeoLite2-Country-CSV.zip from MaxMind, then unzip it to geolite2 directory
  • Navigate to project root directory: cd geoip
  • Install project dependencies: go mod download
  • Generate files: go run ./

go run ./ will use config.json in current directory as the default config file. The generated files are located at output directory by default.

Run go run ./ --help for more usage information. See config-example.json for more configuration options.

CLI showcase

$ ./geoip -h

Usage of ./geoip:
  -c string
    	Path to the config file (default "config.json")
  -l	List all available input and output formats


$ ./geoip -l

All available input formats:
  - maxmindGeoLite2CountryCSV (Convert MaxMind GeoLite2 country CSV data to other formats)
  - private (Convert LAN and private CIDR to other formats)
  - test (Convert specific CIDR to other formats (for test only))
All available output formats:
  - text (Convert data to plaintext format)
  - v2rayGeoIPDat (Convert data to V2Ray GeoIP dat format)

Notice

This product includes GeoLite2 data created by MaxMind, available from MaxMind.

License

CC-BY-SA-4.0

About

GeoIP for V2Ray. Generate geoip.dat for V2Ray automatically every Wednesday.

https://www.v2fly.org

License:Creative Commons Attribution Share Alike 4.0 International


Languages

Language:Go 100.0%