์๊ฐ
๐บAn easy way to manage all your Geo resources. Available as both a CLI and a Go library.
ํ์ต ๋ฐ ๊ต์ก์ธก์ ๋ ์คํ ์ฆ๊ฐ
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- +2
- in 1 month
- ๊ธฐ๋ก ์์ง ์ค
์๋ก ๊ฒน์น๋ ๊ธฐ๊ฐ์ ์์ฆ๊ฐ๋์ด๋ฉฐ ์ผ๋ณ ํฉ๊ณ๊ฐ ์๋๋๋ค. ์ธก์ ๊ฐ์ด ์์ผ๋ฉด ๋น์ ๋ก๋๋ค. ์คํ๋ ๊ด์ฌ๋๋ฅผ ๋ํ๋ด๋ฉฐ ํ์ง์ ๋ณด์ฅํ์ง ์์ต๋๋ค.
README.md
Originalgeo
๐บAn easy way to manage all your Geo resources.
Support GeoIP/GeoSite code lookup and converting among all popular GeoIP/GeoSite databases.
Install
Requirements:
- Go 1.20+
go install -v github.com/metacubex/geo/cmd/geo@master
Usage
Type geo help for more details.
Look up codes from existing Geo databases
The default directory to find Geo databases is
~/.geo. You can specify it through -D argument.
IP
geo look 223.5.5.5
geo look 2001:250::
Site
geo look example.com
geo look --no-resolve example.com
Supported databases for look command:
- MaxMind MMDB
- V2Ray dat GeoIP/GeoSite
- sing-geosite
- sing-geoip MMDB
- Meta-geoip MMDB
Convert
IP
geo convert ip -i <input_type> -o <output_type> -f [output_filename] input_filename
geo convert ip -i v2ray -o meta ./geoip.dat
Available types:
- MaxMind (MMDB)
- V2Ray-geoip (dat)
- sing-geoip (MMDB)
- Meta-geoip (MMDB)
Supported conversion pairs: (Column=From, Row=To)
| MaxMind | V2Ray-geoip | sing-geoip | Meta-geoip | |
|---|---|---|---|---|
| MaxMind | - | |||
| V2Ray | - | |||
| sing-geoip | โ | โ | - | โ |
| Meta-geoip | โ | - |
Conversion to MaxMind is not available for legal reasons.
Conversion to V2Ray is on the TODO list.
Site
geo convert site -i <input_type> -o <output_type> -f [output_filename] -c [country code] input_filename
geo convert site -i v2ray -o sing ./geosite.dat
Only v2ray -> sing conversion is supported for GeoSite.
Unpack
site
geo unpack site ./geosite.dat -d output -c cn
- -d output dir
- -c code (optional, unpack all geosite if not set)
Frequently Asked Questions (FAQ)
Why conversion MaxMind/sing-geoip -> Meta-geoip is not available?
Meta-geoip is designed to support IP with multiple results, which will help users who use GeoIP functionality as IPList or IPSet.
For sources such as MaxMind and sing-geoip, which only have a single possible result,
according to the principle of Occam's razor, there is no need to convert to Meta-geoip database.
In the other hand, when there is only a single result,
the data structure of Meta-geoip and sing-geoip is completely consistent,
and even compatible with the parsing logic.
Clash.Meta supports all of these databases, so everything is well. :-)
๊ด๋ จ ํ๋ก์ ํธ ์ดํด๋ณด๊ธฐ
๋ถ๋ฌ์ค๋ ์คโฆ