All Projects → Loyalsoldier → geoip

Loyalsoldier / geoip

Licence: CC-BY-SA-4.0 License
🌚 🌍 🌝 GeoIP 规则文件加强版,同时支持定制 V2Ray dat 格式路由规则文件 geoip.dat 和 MaxMind mmdb 格式文件 Country.mmdb。Enhanced edition of GeoIP files for V2Ray, Xray-core, Trojan-Go, Clash and Leaf, with replaced CN IPv4 CIDR available from ipip.net, appended CIDR lists and more.

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to geoip

V2ray Rules Dat
🦄 🎃 👻 V2Ray 路由规则文件加强版,可代替 V2Ray 官方 geoip.dat 和 geosite.dat,兼容 Shadowsocks-windows、Xray-core、Trojan-Go 和 leaf。Enhanced edition of V2Ray rules dat files, compatible with Xray-core, Shadowsocks-windows, Trojan-Go and leaf.
Stars: ✭ 6,550 (+1150%)
Mutual labels:  routing, anticensorship, geoip, v2ray, gfw, xray, chinalist, trojan-go
Surge Rules
🦄 🎃 👻 Surge 规则集(DOMAIN-SET 和 RULE-SET),兼容 Surge for iOS 和 Surge for Mac 客户端。
Stars: ✭ 151 (-71.18%)
Mutual labels:  routing, anticensorship, v2ray, gfw
Proxysu
Xray,V2ray,Trojan,NaiveProxy, Trojan-Go, ShadowsocksR(SSR),Shadowsocks-libev及相关插件,MTProto+TLS 一键安装工具,windows下用(一键科学上网)
Stars: ✭ 3,309 (+531.49%)
Mutual labels:  ipv6, v2ray, xray, trojan-go
freebind
IPv4 and IPv6 address rate limiting evasion tool
Stars: ✭ 88 (-83.21%)
Mutual labels:  ipv6, ipv4, ipv4-address, ipv6-address
Geolocate-IP-Browser-Extension
A browser extension, which shows you the origin of your IP address.
Stars: ✭ 21 (-95.99%)
Mutual labels:  ipv6, ipv4, ipv4-address, ipv6-address
ipv6calc
ipv6calc
Stars: ✭ 33 (-93.7%)
Mutual labels:  ipv6, ipv4, ipv4-address, ipv6-address
Clash Rules
🦄️ 🎃 👻 Clash Premium 规则集(RULE-SET),兼容 ClashX Pro、Clash for Windows 客户端。
Stars: ✭ 706 (+34.73%)
Mutual labels:  routing, anticensorship, v2ray, gfw
fakeroute
IPv4 and IPv6 traceroute fake hop generator through IP spoofing
Stars: ✭ 75 (-85.69%)
Mutual labels:  ipv6, ipv4, ipv6-address
Trojan Go
Go实现的Trojan代理,支持多路复用/路由功能/CDN中转/Shadowsocks混淆插件,多平台,无依赖。A Trojan proxy written in Go. An unidentifiable mechanism that helps you bypass GFW. https://p4gefau1t.github.io/trojan-go/
Stars: ✭ 4,049 (+672.71%)
Mutual labels:  anticensorship, gfw, trojan-go
ip-finder-cli
The official command line client for IPFinder
Stars: ✭ 11 (-97.9%)
Mutual labels:  ipv6, ipv4, geoip
ipv6
IPv6-adresse.dk source & data
Stars: ✭ 27 (-94.85%)
Mutual labels:  ipv6, ipv4, ipv6-address
v2ray
每日分享免费节点、免费机场、ssr节点、v2ray节点、v2ray订阅、clash节点、clash订阅、shadowrocket订阅、Quantumult X订阅、Clash .NET订阅、小火箭节点、小猫咪节点、免费翻墙、免费科学上网、免费梯子、免费trojan节点、蓝灯、谷歌商店、翻墙梯子、安卓VPN、iphone翻墙节点、iphone vpn、一键翻墙浏览器、节点分享、免费SSR、蓝灯、谷歌商店、V2ary免费节点、代理、proxy代理科学上网、TG代理、电报代理、Telegram代理、ip加速、翻墙软件、socks5、破解VPN、机场推荐、节点订阅、破解VPN
Stars: ✭ 525 (+0.19%)
Mutual labels:  clash, v2ray, gfw
whereabouts
An HTTP service for mapping IPv4 and IPv6 addresses to cities, countries & continents
Stars: ✭ 16 (-96.95%)
Mutual labels:  ipv6, ipv4, geoip
PHP-IPAddress
IP Address utility classes for PHP
Stars: ✭ 63 (-87.98%)
Mutual labels:  ipv6, ipv4, ipv6-address
Ip
🌏根据IpV4、IpV6地址获取定位信息的PHP🐘组件 PHP components that obtain location information based on IpV4, IpV6 addresses
Stars: ✭ 23 (-95.61%)
Mutual labels:  ipv6, ipv4, ipv4-address
get subscribe
✈️ 免费机场 / 免费VPN -> 自动获取免 clash/v2ray/trojan/sr/ssr 订阅链接,间隔12小时持续更新 | 科学上网 | 翻墙
Stars: ✭ 1,512 (+188.55%)
Mutual labels:  clash, v2ray, trojan-go
go-inet
A Go library for reading, formatting, sorting, lookup and converting IP-addresses and IP-blocks
Stars: ✭ 14 (-97.33%)
Mutual labels:  ipv6, ipv4
go-net-radix
Go bindings for radix tree library for fast subnet (IPv4 and IPv6) lookups
Stars: ✭ 37 (-92.94%)
Mutual labels:  ipv6, ipv4
trojan-go-panel
🦄 trojan-go 管理面板。一键部署,多节点监控,多用户管理,可设置日期限制、流量限制,一键生成动态订阅链接。项目持续更新中,欢迎提出宝贵建议。
Stars: ✭ 42 (-91.98%)
Mutual labels:  clash, trojan-go
ipv6gen
IPv6 prefix generator
Stars: ✭ 32 (-93.89%)
Mutual labels:  ipv6, ipv6-address

简介

本项目每周四自动生成 GeoIP 文件,同时提供命令行界面(CLI)供用户自行定制 GeoIP 文件,包括但不限于 V2Ray dat 格式路由规则文件 geoip.dat 和 MaxMind mmdb 格式文件 Country.mmdb

This project releases GeoIP files automatically every Thursday. It also provides a command line interface(CLI) for users to customize their own GeoIP files, included but not limited to V2Ray dat format file geoip.dat and MaxMind mmdb format file Country.mmdb.

与官方版 GeoIP 的区别

  • 中国大陆 IPv4 地址数据使用 IPIP.net
  • 新增类别(方便有特殊需求的用户使用):
    • geoip:cloudflareGEOIP,CLOUDFLARE
    • geoip:cloudfrontGEOIP,CLOUDFRONT
    • geoip:facebookGEOIP,FACEBOOK
    • geoip:fastlyGEOIP,FASTLY
    • geoip:googleGEOIP,GOOGLE
    • geoip:netflixGEOIP,NETFLIX
    • geoip:telegramGEOIP,TELEGRAM
    • geoip:twitterGEOIP,TWITTER

参考配置

V2Ray 中使用本项目 .dat 格式文件的参考配置:

"routing": {
  "rules": [
    {
      "type": "field",
      "outboundTag": "Direct",
      "ip": [
        "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",
      "ip": [
        "geoip:us",
        "geoip:jp",
        "geoip:facebook",
        "geoip:telegram",
        "ext:geoip-asn.dat:facebook",
        "ext:geoip-asn.dat:telegram"
      ]
    }
  ]
}

Clash 中使用本项目 .mmdb 格式文件的参考配置:

rules:
  - GEOIP,PRIVATE,policy,no-resolve
  - GEOIP,FACEBOOK,policy
  - GEOIP,CN,policy,no-resolve

Leaf 中使用本项目 .mmdb 格式文件的参考配置,查看官方 README

下载地址

如果无法访问域名 raw.githubusercontent.com,可以使用第二个地址 cdn.jsdelivr.net。 *.sha256sum 为校验文件。

V2Ray dat 格式路由规则文件

适用于 V2RayXray-coreTrojan-Go

MaxMind mmdb 格式文件

适用于 ClashLeaf

定制 GeoIP 文件

可通过以下几种方式定制 GeoIP 文件:

  • 在线生成Fork 本仓库后,修改自己仓库内的配置文件 config.json 和 GitHub Workflow .github/workflows/build.yml
  • 本地生成
    • 安装 GolangGit
    • 拉取项目代码: git clone https://github.com/Loyalsoldier/geoip.git
    • 进入项目根目录:cd geoip
    • 修改配置文件 config.json
    • 运行代码:go run ./

特别说明:

  • 在线生成Fork 本项目后,如果需要使用 MaxMind GeoLite2 Country CSV 数据文件,需要在自己仓库的 [Settings] 选项卡的 [Secrets] 页面中添加一个名为 MAXMIND_GEOLITE2_LICENSE 的 secret,否则 GitHub Actions 会运行失败。这个 secret 的值为 MAXMIND 账号的 LICENSE KEY,需要注册 MAXMIND 账号后,在个人账号管理页面左侧边栏的 [Services] 项下的 [My License Key] 里生成。
  • 本地生成:如果需要使用 MaxMind GeoLite2 Country CSV 数据文件(GeoLite2-Country-CSV.zip),需要提前从 MaxMind 下载,或从本项目 release 分支下载,并解压缩到名为 geolite2 的目录。

概念解析

本项目有两个概念:inputoutputinput 指数据源(data source)及其输入格式,output 指数据的去向(data destination)及其输出格式。CLI 的作用就是通过读取配置文件中的选项,聚合用户提供的所有数据源,去重,将其转换为目标格式,并输出到文件。

These two concepts are notable: input and output. The input is the data source and its input format, whereas the output is the destination of the converted data and its output format. What the CLI does is to aggregate all input format data, then convert them to output format and write them to GeoIP files by using the options in the config file.

支持的格式

关于每种格式所支持的配置选项,查看本项目 config-example.json 文件。

支持的 input 输入格式:

  • text:纯文本 IP 和 CIDR(例如:1.1.1.11.0.0.0/24
  • private:局域网和私有网络 CIDR(例如:192.168.0.0/16127.0.0.0/8
  • cutter:用于裁剪前置步骤中的数据
  • v2rayGeoIPDat:V2Ray GeoIP dat 格式(geoip.dat
  • maxmindGeoLite2CountryCSV:MaxMind GeoLite2 country CSV 数据(GeoLite2-Country-CSV.zip
  • clashRuleSetClassicalclassical 类型的 Clash RuleSet
  • clashRuleSetipcidr 类型的 Clash RuleSet
  • surgeRuleSetSurge RuleSet

支持的 output 输出格式:

CLI 功能展示

可通过 go install -v github.com/Loyalsoldier/geoip@latest 直接安装 CLI。

$ ./geoip -h
Usage of ./geoip:
  -c string
    	URI of the JSON format config file, support both local file path and remote HTTP(S) URL (default "config.json")
  -l	List all available input and output formats

$ ./geoip -c config.json
2021/08/29 12:11:35 ✅ [v2rayGeoIPDat] geoip.dat --> output/dat
2021/08/29 12:11:35 ✅ [v2rayGeoIPDat] geoip-only-cn-private.dat --> output/dat
2021/08/29 12:11:35 ✅ [v2rayGeoIPDat] geoip-asn.dat --> output/dat
2021/08/29 12:11:35 ✅ [v2rayGeoIPDat] cn.dat --> output/dat
2021/08/29 12:11:35 ✅ [v2rayGeoIPDat] private.dat --> output/dat
2021/08/29 12:11:39 ✅ [maxmindMMDB] Country.mmdb --> output/maxmind
2021/08/29 12:11:39 ✅ [maxmindMMDB] Country-only-cn-private.mmdb --> output/maxmind
2021/08/29 12:11:39 ✅ [text] netflix.txt --> output/text
2021/08/29 12:11:39 ✅ [text] telegram.txt --> output/text
2021/08/29 12:11:39 ✅ [text] cn.txt --> output/text
2021/08/29 12:11:39 ✅ [text] cloudflare.txt --> output/text
2021/08/29 12:11:39 ✅ [text] cloudfront.txt --> output/text
2021/08/29 12:11:39 ✅ [text] facebook.txt --> output/text
2021/08/29 12:11:39 ✅ [text] fastly.txt --> output/text

$ ./geoip -l
All available input formats:
  - v2rayGeoIPDat (Convert V2Ray GeoIP dat to other formats)
  - maxmindGeoLite2CountryCSV (Convert MaxMind GeoLite2 country CSV data to other formats)
  - private (Convert LAN and private network CIDR to other formats)
  - text (Convert plaintext IP & CIDR to other formats)
  - clashRuleSetClassical (Convert classical type of Clash RuleSet to other formats (just processing IP & CIDR lines))
  - clashRuleSet (Convert ipcidr type of Clash RuleSet to other formats)
  - surgeRuleSet (Convert Surge RuleSet to other formats (just processing IP & CIDR lines))
  - cutter (Remove data from previous steps)
  - test (Convert specific CIDR to other formats (for test only))
All available output formats:
  - v2rayGeoIPDat (Convert data to V2Ray GeoIP dat format)
  - maxmindMMDB (Convert data to MaxMind mmdb database format)
  - clashRuleSetClassical (Convert data to classical type of Clash RuleSet)
  - clashRuleSet (Convert data to ipcidr type of Clash RuleSet)
  - surgeRuleSet (Convert data to Surge RuleSet)
  - text (Convert data to plaintext CIDR format)

激赏 | Donation

  • 比特币(BTC)bech32 地址:bc1qfe4nxcanet4w4ph8pf6qqyf263y68vw26nv9j9
  • 比特币(BTC)地址:3PRyneb1D7jFFBakAaJiCRSsxsXAtMr7LN

License

CC-BY-SA-4.0

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].