mirror of
https://github.com/Loyalsoldier/v2ray-rules-dat.git
synced 2026-01-13 04:57:12 +08:00
Compare commits
67 Commits
2019121505
...
2020021022
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1c4eaeefb | ||
|
|
bb36e65e02 | ||
|
|
546547e7ae | ||
|
|
1953b6a1bb | ||
|
|
b3b6304a12 | ||
|
|
ce4c3ee3d7 | ||
|
|
77698a15f7 | ||
|
|
e4c729bf44 | ||
|
|
686c2d3c29 | ||
|
|
f8094e3e00 | ||
|
|
bc7c8f7a4c | ||
|
|
82a87b23e6 | ||
|
|
b1148f1bb7 | ||
|
|
3a83e3911d | ||
|
|
ffc54de20e | ||
|
|
ec270174fb | ||
|
|
9eb1fd129d | ||
|
|
1a03c37bae | ||
|
|
f8bb1017c6 | ||
|
|
749e420c3f | ||
|
|
6fb2569a68 | ||
|
|
7230e8cffc | ||
|
|
a9b458de22 | ||
|
|
b080e37d6e | ||
|
|
ee6546bc2a | ||
|
|
588b482047 | ||
|
|
306fc08df1 | ||
|
|
c65313fd83 | ||
|
|
4ef01bc102 | ||
|
|
b7eb8202da | ||
|
|
b735c06461 | ||
|
|
5124b0d821 | ||
|
|
72906569ad | ||
|
|
7156a11754 | ||
|
|
f5451027e9 | ||
|
|
5af129797e | ||
|
|
5958c2493c | ||
|
|
eb61e68d38 | ||
|
|
cadd037384 | ||
|
|
e2ae2400b4 | ||
|
|
2168f18cac | ||
|
|
21f766dc39 | ||
|
|
4e4ef7bd85 | ||
|
|
d9620ae732 | ||
|
|
d07c21c7eb | ||
|
|
db68429e18 | ||
|
|
4923596b20 | ||
|
|
bd7139d162 | ||
|
|
61a8ee2ffb | ||
|
|
64a26fcddc | ||
|
|
fc3bebe736 | ||
|
|
1c6f0fa3a9 | ||
|
|
e2b975cda1 | ||
|
|
b2793662b8 | ||
|
|
dfd0c980ef | ||
|
|
c13336200f | ||
|
|
10fd8faee8 | ||
|
|
080d51e91c | ||
|
|
c314c2dd1d | ||
|
|
8291a04cdc | ||
|
|
64dbf736cb | ||
|
|
7ed56de602 | ||
|
|
2f065c5b37 | ||
|
|
58b06a5887 | ||
|
|
9ad5f9fd0d | ||
|
|
8888445e2e | ||
|
|
4943b40560 |
136
.github/workflows/build.yml
vendored
136
.github/workflows/build.yml
vendored
@@ -1,10 +1,10 @@
|
||||
name: Build v2ray rules dat files
|
||||
name: Build V2Ray rules dat files
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 19 * * *"
|
||||
- cron: "0 22 * * *"
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -12,28 +12,43 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Set up Go 1.13
|
||||
- name: Setup Go 1.13
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.13
|
||||
id: go
|
||||
|
||||
- name: Set GOPATH
|
||||
- name: Set $GOPATH and more variables
|
||||
run: |
|
||||
echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)"
|
||||
echo "::set-env name=GREEN::\033[0;32m"
|
||||
echo "::set-env name=NC::\033[0m"
|
||||
echo "::set-env name=NAME::Released on $(date +%Y%m%d%H%M)"
|
||||
echo "::set-env name=TAG_NAME::$(date +%Y%m%d%H%M)"
|
||||
echo "::set-env name=GEOIP_REPO::github.com/v2ray/geoip"
|
||||
echo "::set-env name=GEOSITE_REPO::github.com/v2ray/domain-list-community"
|
||||
echo "::set-env name=GFWLIST_URL::https://cokebar.github.io/gfwlist2dnsmasq/gfwlist_domain.txt"
|
||||
echo "::set-env name=Profiles_URL::https://raw.githubusercontent.com/ConnersHua/Profiles/master/Shadow/Pro.conf"
|
||||
echo "::set-env name=CHINA_DOMAINS_URL::https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf"
|
||||
echo "::set-env name=GOOGLE_DOMAINS_URL::https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf"
|
||||
echo "::set-env name=APPLE_DOMAINS_URL::https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf"
|
||||
echo "::set-env name=CDN_DOMAINS_URL::https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/removed-cdn.txt"
|
||||
echo "::set-env name=GFWLIST_DOMAINS_URL::https://cokebar.github.io/gfwlist2dnsmasq/gfwlist_domain.txt"
|
||||
echo "::set-env name=GREATFIRE_DOMAINS_URL::https://raw.githubusercontent.com/wongsyrone/domain-block-list/master/domains.txt"
|
||||
echo "::set-env name=PROFILES_URL::https://raw.githubusercontent.com/ConnersHua/Profiles/master/Shadow/Pro.conf"
|
||||
echo "::set-env name=GEQ1AN_RULES_APPLE_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/Apple.list"
|
||||
echo "::set-env name=GEQ1AN_RULES_MICROSOFT_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/Microsoft.list"
|
||||
echo "::set-env name=GEQ1AN_RULES_GLOBAL_MEDIA_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/GMedia.list"
|
||||
echo "::set-env name=GEQ1AN_RULES_OUTSIDE_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/Outside.list"
|
||||
echo "::set-env name=GEQ1AN_RULES_REJECT_URL::https://raw.githubusercontent.com/GeQ1an/Rules/master/QuantumultX/Filter/AdBlock.list"
|
||||
echo "::set-env name=LHIE1_RULES_REJECT_URL::https://raw.githubusercontent.com/lhie1/Rules/master/Auto/REJECT.conf"
|
||||
echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)"
|
||||
echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin"
|
||||
shell: bash
|
||||
|
||||
- name: Get GeoLite2
|
||||
- name: Checkout the "hidden" branch
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: hidden
|
||||
|
||||
- name: Get GeoLite2 zip file
|
||||
run: |
|
||||
curl -sSL -O https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip
|
||||
curl -L -o GeoLite2-Country-CSV.zip "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country-CSV&license_key=JvbzLLx7qBZT&suffix=zip"
|
||||
unzip GeoLite2-Country-CSV.zip
|
||||
rm -f GeoLite2-Country-CSV.zip
|
||||
mv GeoLite2* geoip
|
||||
@@ -49,86 +64,59 @@ jobs:
|
||||
run: |
|
||||
go get -u -v -insecure $GEOSITE_REPO
|
||||
|
||||
- name: Get and add gfwlist into geolocation-!cn
|
||||
- name: Get and add direct domains into temp-direct.txt file
|
||||
run: |
|
||||
cd $GOPATH/src/$GEOSITE_REPO/data
|
||||
curl -sSL $GFWLIST_URL > gfwlist
|
||||
echo "include:gfwlist" >> geolocation-\!cn
|
||||
curl -sSL $CHINA_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' > temp-direct.txt
|
||||
|
||||
- name: Get and add proxy domains from @ConnersHua/Profiles into geolocation-!cn
|
||||
- name: Get and add proxy domains into temp-proxy.txt file
|
||||
run: |
|
||||
cd $GOPATH/src/$GEOSITE_REPO/data
|
||||
curl -sSL $Profiles_URL | awk '/^DOMAIN.+PROXY/' | cut -d ',' -f 2 > profileproxy
|
||||
echo "include:profileproxy" >> geolocation-\!cn
|
||||
curl -sSL $GFWLIST_DOMAINS_URL | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > temp-proxy.txt
|
||||
curl -sSL $GREATFIRE_DOMAINS_URL | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' >> temp-proxy.txt
|
||||
curl -sSL $GOOGLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' >> temp-proxy.txt
|
||||
curl -sSL $APPLE_DOMAINS_URL | perl -ne '/^server=\/([^\/]+)\// && print "$1\n"' >> temp-proxy.txt
|
||||
curl -sSL $CDN_DOMAINS_URL| perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' >> temp-proxy.txt
|
||||
curl -sSL $PROFILES_URL | awk -F ',' '/^DOMAIN(,|\-SUFFIX,).+PROXY/ {print $2}' >> temp-proxy.txt
|
||||
curl -sSL $GEQ1AN_RULES_APPLE_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+Apple/ {print $2}' >> temp-proxy.txt
|
||||
curl -sSL $GEQ1AN_RULES_MICROSOFT_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+Microsoft/ {print $2}' >> temp-proxy.txt
|
||||
curl -sSL $GEQ1AN_RULES_GLOBAL_MEDIA_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+GMedia/ {print $2}' >> temp-proxy.txt
|
||||
curl -sSL $GEQ1AN_RULES_OUTSIDE_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+Outside/ {print $2}' >> temp-proxy.txt
|
||||
|
||||
- name: Get and add direct domains from @ConnersHua/Profiles into cn
|
||||
- name: Get and add reject domains into temp-reject.txt file
|
||||
run: |
|
||||
cd $GOPATH/src/$GEOSITE_REPO/data
|
||||
curl -sSL $Profiles_URL | awk '/^DOMAIN.+DIRECT/' | cut -d ',' -f 2 > profiledirect
|
||||
echo "include:profiledirect" >> cn
|
||||
curl -sSL $PROFILES_URL | awk -F ',' '/^DOMAIN(,|\-SUFFIX,).+REJECT/ {print $2}' > temp-reject.txt
|
||||
curl -sSL $GEQ1AN_RULES_REJECT_URL | awk -F ',' '/^(HOST|DOMAIN)(,|\-SUFFIX,).+AdBlock/ {print $2}' >> temp-reject.txt
|
||||
curl -sSL $LHIE1_RULES_REJECT_URL | awk -F ',' '/^DOMAIN(,|\-SUFFIX,).+REJECT/ {print $2}' >> temp-reject.txt
|
||||
|
||||
- name: Get and add chinalist into cn
|
||||
- name: Add proxy and direct domains from "hidden" branch to appropriate temp files
|
||||
run: |
|
||||
cd $GOPATH/src/$GEOSITE_REPO/data
|
||||
curl -sSL $CHINA_DOMAINS_URL | awk -F '/' '{print $2}' > chinalist
|
||||
echo "include:chinalist" >> cn
|
||||
cat proxy.txt >> temp-proxy.txt
|
||||
cat direct.txt >> temp-direct.txt
|
||||
|
||||
- name: Get and add reject domains from @ConnersHua/Profiles into category-ads-all
|
||||
- name: Sort and generate lists
|
||||
run: |
|
||||
cat temp-proxy.txt | sort --ignore-case -u | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > $GOPATH/src/$GEOSITE_REPO/data/proxylist
|
||||
cat temp-proxy.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > proxy-excluse-list.txt
|
||||
cat temp-direct.txt | sort --ignore-case -u | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > $GOPATH/src/$GEOSITE_REPO/data/directlist
|
||||
cat temp-direct.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > direct-excluse-list.txt
|
||||
cat temp-reject.txt | sort --ignore-case -u | perl -ne '/^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/ && print "$1\n"' > $GOPATH/src/$GEOSITE_REPO/data/rejectlist
|
||||
cat temp-reject.txt | sort --ignore-case -u | perl -ne 'print if not /^((?=^.{3,255})[a-zA-Z0-9][-_a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-_a-zA-Z0-9]{0,62})+)/' > reject-excluse-list.txt
|
||||
|
||||
- name: Add list into appropriate category file
|
||||
run: |
|
||||
cd $GOPATH/src/$GEOSITE_REPO/data
|
||||
curl -sSL $Profiles_URL | awk '/^DOMAIN.+REJECT/' | cut -d ',' -f 2 > profilereject
|
||||
echo "include:profilereject" >> category-ads-all
|
||||
echo "include:proxylist" >> geolocation-\!cn
|
||||
echo "include:directlist" >> cn
|
||||
echo "include:rejectlist" >> category-ads-all
|
||||
|
||||
- name: Build geosite.dat file
|
||||
run: |
|
||||
domain-list-community
|
||||
mv ./dlc.dat ./publish/geosite.dat
|
||||
|
||||
- name: List above process results
|
||||
run: |
|
||||
echo ">>>>>>>>>>>>>>>>>>>>>>>>"
|
||||
|
||||
echo "list files in data folder"
|
||||
ls -lah $GOPATH/src/$GEOSITE_REPO/data
|
||||
|
||||
echo ">>>>>>>>>>>>>>>>>>>>>>>>"
|
||||
|
||||
echo "list last 10 lines of cn file"
|
||||
tail -n 10 $GOPATH/src/$GEOSITE_REPO/data/cn
|
||||
|
||||
echo ">>>>>>>>>>>>>>>>>>>>>>>>"
|
||||
|
||||
echo "list last 10 lines of geolocation-!cn file"
|
||||
tail -n 10 $GOPATH/src/$GEOSITE_REPO/data/geolocation-\!cn
|
||||
|
||||
echo ">>>>>>>>>>>>>>>>>>>>>>>>"
|
||||
|
||||
echo "list last 10 lines of category-ads-all file"
|
||||
tail -n 10 $GOPATH/src/$GEOSITE_REPO/data/category-ads-all
|
||||
|
||||
echo ">>>>>>>>>>>>>>>>>>>>>>>>"
|
||||
|
||||
echo "list files in publish folder"
|
||||
ls -lah ./publish
|
||||
|
||||
echo ">>>>>>>>>>>>>>>>>>>>>>>>"
|
||||
|
||||
echo -e "${GREEN}完成啦!🌈${NC}"
|
||||
|
||||
- name: Set release variables
|
||||
run: |
|
||||
echo "::set-env name=NAME::Released on $(date +%Y%m%d%H%M)"
|
||||
echo "::set-env name=TAG_NAME::$(date +%Y%m%d%H%M)"
|
||||
mv ./*-excluse-list.txt ./publish/
|
||||
cp -f $GOPATH/src/$GEOSITE_REPO/data/{proxy,direct,reject}list ./publish/
|
||||
|
||||
- name: Release dat files
|
||||
uses: Ricky-Hao/action-release@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ASSET_PATH: publish
|
||||
|
||||
- name: Upload dat files
|
||||
uses: actions/upload-artifact@master
|
||||
if: success()
|
||||
with:
|
||||
name: dat_files
|
||||
path: publish
|
||||
|
||||
299
README.md
299
README.md
@@ -1,6 +1,6 @@
|
||||
# 简介
|
||||
|
||||
**v2ray** 加强版规则文件,可代替 v2ray 官方 `geoip.dat` 和 `geosite.dat` 文件。利用 GitHub Actions 每天自动构建,保证最新。
|
||||
**V2Ray** 规则文件加强版,可代替 V2Ray 官方 `geoip.dat` 和 `geosite.dat` 规则文件。利用 GitHub Actions 北京时间每天早上 6 点自动构建,保证规则最新。
|
||||
|
||||
## 规则文件生成方式
|
||||
|
||||
@@ -8,55 +8,226 @@
|
||||
|
||||
- 通过仓库 [@v2ray/geoip](https://github.com/v2ray/geoip) 生成
|
||||
- 其中 IP 地址来源于 [MaxMind 免费 IP](https://dev.maxmind.com/geoip/geoip2/geolite2/)
|
||||
- **优点**:由于项目每天自动构建,所以更新速度比官方 `geoip.dat` 要快得多
|
||||
|
||||
### geosite.dat
|
||||
|
||||
- 通过仓库 [@v2ray/domain-list-community](https://github.com/v2ray/domain-list-community) 生成
|
||||
- **优点**:由于项目每天自动构建,所以更新速度比官方 `geosite.dat` 要快得多
|
||||
- **加入大量中国大陆域名**:通过仓库 [@felixonmars/dnsmasq-china-list](https://github.com/felixonmars/dnsmasq-china-list) 生成 `chinalist` 类别域名并加入到 `geosite:cn` 类别中
|
||||
- **加入最新 GFWList**:通过仓库 [@cokebar/gfwlist2dnsmasq](https://github.com/cokebar/gfwlist2dnsmasq) 生成 `gfwlist` 类别域名并加入到 `geosite:geolocation-!cn` 类别中
|
||||
- **加入更多直连、代理、广告域名**:通过仓库 [@ConnersHua/Profiles](https://github.com/ConnersHua/Profiles/tree/master) 获取更多直连、代理、广告域名,并分别加入到 `geosite:cn`、`geosite:geolocation-!cn` 和 `geosite:category-ads-all` 类别中
|
||||
- **加入大量中国大陆域名、Apple 域名、Google 域名和部分海外 CDN 域名**:
|
||||
- [@felixonmars/dnsmasq-china-list/accelerated-domains.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/accelerated-domains.china.conf) 加入到 `geosite:cn` 类别中
|
||||
- [@felixonmars/dnsmasq-china-list/apple.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/apple.china.conf) 加入到 `geosite:geolocation-!cn` 类别中
|
||||
- [@felixonmars/dnsmasq-china-list/google.china.conf](https://github.com/felixonmars/dnsmasq-china-list/blob/master/google.china.conf) 加入到 `geosite:geolocation-!cn` 类别中
|
||||
- [@felixonmars/dnsmasq-china-list/removed-cdn.txt](https://github.com/felixonmars/dnsmasq-china-list/blob/master/removed-cdn.txt) 加入到 `geosite:geolocation-!cn` 类别中
|
||||
- **加入最新 GFWList 域名**:通过仓库 [@cokebar/gfwlist2dnsmasq](https://github.com/cokebar/gfwlist2dnsmasq) 生成并加入到 `geosite:geolocation-!cn` 类别中
|
||||
- **加入 Greatfire Analyzer 检测到的屏蔽域名**:通过仓库 [@wongsyrone/domain-block-list](https://github.com/wongsyrone/domain-block-list) 获取 [Greatfire Analyzer](https://zh.greatfire.org/analyzer) 检测到的屏蔽域名,并加入到 `geosite:geolocation-!cn` 类别中
|
||||
- **加入更多代理域名和广告域名**:通过仓库 [@ConnersHua/Profiles](https://github.com/ConnersHua/Profiles/tree/master)、[@GeQ1an/Rules](https://github.com/GeQ1an/Rules/tree/master/QuantumultX) 和 [@lhie1/Rules](https://github.com/lhie1/Rules/tree/master) 获取更多代理域名、广告域名,并分别加入到 `geosite:geolocation-!cn` 和 `geosite:category-ads-all` 类别中
|
||||
- **加入自定义直连和代理域名**:由于上游域名列表更新缓慢或缺失某些被屏蔽的域名,所以引入自定义域名列表,主要为了解决在 DNS 解析 `A` 和 `AAAA` 记录时的 DNS 泄漏问题。[`hidden` 分支](https://github.com/Loyalsoldier/v2ray-rules-dat/tree/hidden)里有两个文件 `direct.txt` 和 `proxy.txt`,分别放置自定义的直连、代理域名,最终分别加入到 `geosite:cn` 和 `geosite:geolocation-!cn` 类别中
|
||||
|
||||
## 使用方式
|
||||
## 规则文件下载及使用方式
|
||||
|
||||
1. [点击进入规则文件发布页面](https://github.com/Loyalsoldier/v2ray-rules-dat/releases),点击下载位于最上方的 `geoip.dat` 和 `geosite.dat`
|
||||
2. 把下载下来的 `geoip.dat` 和 `geosite.dat` 文件放入到 v2ray 软件的规则文件目录,替换掉原来的 `geoip.dat` 和 `geosite.dat`
|
||||
3. 修改 v2ray 配置文件。配置参考下面👇
|
||||
**下载地址**:
|
||||
|
||||
- **geoip.dat**:[https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat](https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat)
|
||||
- **geosite.dat**:[https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat](https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat)
|
||||
|
||||
**使用方式**:
|
||||
|
||||
1. 通过上面下载地址或[点击进入规则文件发布页面](https://github.com/Loyalsoldier/v2ray-rules-dat/releases),下载 `geoip.dat` 和 `geosite.dat`
|
||||
2. 把下载下来的 `geoip.dat` 和 `geosite.dat` 文件放入到 V2Ray 软件的规则文件目录,替换掉原来的 `geoip.dat` 和 `geosite.dat`
|
||||
3. 修改 V2Ray 配置文件,配置参考下面 👇👇👇
|
||||
|
||||
## 参考配置
|
||||
|
||||
### geoip.dat
|
||||
|
||||
跟 v2ray 官方 `geoip.dat` 配置方式相同。
|
||||
跟 V2Ray 官方 `geoip.dat` 配置方式相同。
|
||||
|
||||
Routing 配置方式:
|
||||
**Routing 配置方式**:
|
||||
|
||||
```json
|
||||
{
|
||||
"routing": {
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Direct",
|
||||
"ip": [
|
||||
"geoip:cn",
|
||||
"geoip:private"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
"routing": {
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Direct",
|
||||
"ip": [
|
||||
"geoip:cn",
|
||||
"geoip:private"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### geosite.dat
|
||||
|
||||
跟 v2ray 官方 `geosite.dat` 配置方式相同。
|
||||
跟 V2Ray 官方 `geosite.dat` 配置方式相同。
|
||||
|
||||
Routing 配置方式:
|
||||
**Routing 配置方式**:
|
||||
|
||||
```json
|
||||
"routing": {
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Reject",
|
||||
"domain": [
|
||||
"geosite:category-ads-all"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Proxy",
|
||||
"domain": [
|
||||
"geosite:geolocation-!cn"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Direct",
|
||||
"domain": [
|
||||
"geosite:cn"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**DNS 配置方式**:
|
||||
|
||||
```json
|
||||
"dns": {
|
||||
"servers": [
|
||||
{
|
||||
"address": "1.1.1.1",
|
||||
"port": 53,
|
||||
"domains": [
|
||||
"geosite:geolocation-!cn"
|
||||
]
|
||||
},
|
||||
{
|
||||
"address": "114.114.114.114",
|
||||
"port": 53,
|
||||
"domains": [
|
||||
"geosite:cn"
|
||||
]
|
||||
},
|
||||
"8.8.8.8",
|
||||
"223.5.5.5"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### 自用 V2Ray 客户端完整配置(仅供参考,根据自身需求酌情修改)
|
||||
|
||||
下面为自用 V2Ray 客户端完整配置,注意事项:
|
||||
|
||||
- 由于下面客户端配置使用了 DoH DNS 功能,所以必须使用 v4.22.0 或更新版本的 [V2Ray](https://github.com/v2ray/v2ray-core/releases)
|
||||
- 下面客户端配置使 V2Ray 在本机开启 SOCKS 代理(监听 1080 端口)和 HTTP 代理(监听 2080 端口)
|
||||
- BT 流量统统直连(实测依然会有部分 BT 流量走代理,尚不清楚是不是 V2Ray 的 bug。如果服务商禁止 BT 下载的话,请不要为下载软件设置代理)
|
||||
- 最后,不命中任何路由规则的请求和流量,统统走代理
|
||||
- `outbounds` 里的第一个大括号内的配置,即为 V2Ray 代理服务的配置。请根据自身需求进行修改,并参照 V2Ray 官网配置说明中的 [配置文件 > 文件格式 > OutboundObject](https://v2ray.com/chapter_02/01_overview.html#outboundobject) 部分进行补全
|
||||
|
||||
```json
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "warning"
|
||||
},
|
||||
"dns": {
|
||||
"servers": [
|
||||
{
|
||||
"address": "https://1.1.1.1/dns-query",
|
||||
"domains": [
|
||||
"geosite:geolocation-!cn",
|
||||
"geosite:speedtest"
|
||||
]
|
||||
},
|
||||
"https://1.1.1.1/dns-query",
|
||||
"https://dns.google/dns-query",
|
||||
{
|
||||
"address": "114.114.114.114",
|
||||
"port": 53,
|
||||
"domains": [
|
||||
"geosite:cn"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "socks",
|
||||
"listen": "127.0.0.1",
|
||||
"port": 1080,
|
||||
"tag": "Socks-In",
|
||||
"settings": {
|
||||
"ip": "127.0.0.1",
|
||||
"udp": true,
|
||||
"auth": "noauth"
|
||||
},
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": ["http", "tls"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"protocol": "http",
|
||||
"listen": "127.0.0.1",
|
||||
"port": 2080,
|
||||
"tag": "Http-In",
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": ["http", "tls"]
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
// 下面这行,协议名称为 socks、shadowsocks 或 vmess 等(记得删除这行文字说明)
|
||||
"protocol": "协议名称",
|
||||
"settings": {},
|
||||
// 下面这行,必须为 Proxy,对应 Routing 里的 outboundTag(记得删除这行文字说明)
|
||||
"tag": "Proxy",
|
||||
"streamSettings": {},
|
||||
"mux": {}
|
||||
},
|
||||
{
|
||||
"protocol": "dns",
|
||||
"tag": "Dns-Out"
|
||||
},
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"tag": "Direct",
|
||||
"settings": {
|
||||
"domainStrategy": "UseIPv4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"protocol": "blackhole",
|
||||
"tag": "Reject",
|
||||
"settings": {
|
||||
"response": {
|
||||
"type": "http"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"routing": {
|
||||
"domainStrategy": "IPIfNonMatch",
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Dns-Out",
|
||||
"inboundTag": [
|
||||
"Socks-In",
|
||||
"Http-In"
|
||||
],
|
||||
"network": "udp",
|
||||
"port": 53
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Direct",
|
||||
"protocol": ["bittorrent"]
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Reject",
|
||||
@@ -68,7 +239,8 @@ Routing 配置方式:
|
||||
"type": "field",
|
||||
"outboundTag": "Proxy",
|
||||
"domain": [
|
||||
"geosite:geolocation-!cn"
|
||||
"geosite:geolocation-!cn",
|
||||
"geosite:speedtest"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -77,35 +249,56 @@ Routing 配置方式:
|
||||
"domain": [
|
||||
"geosite:cn"
|
||||
]
|
||||
},
|
||||
{
|
||||
"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"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Proxy",
|
||||
"ip": [
|
||||
"1.1.1.1/32",
|
||||
"1.0.0.1/32",
|
||||
"8.8.8.8/32",
|
||||
"8.8.4.4/32"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Direct",
|
||||
"ip": [
|
||||
"geoip:cn",
|
||||
"geoip:private"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "Proxy",
|
||||
"ip": [
|
||||
"0.0.0.0/0",
|
||||
"::/0"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
DNS 配置方式:
|
||||
## 致谢
|
||||
|
||||
```json
|
||||
{
|
||||
"dns": {
|
||||
"servers": [
|
||||
{
|
||||
"address": "1.1.1.1",
|
||||
"port": 53,
|
||||
"domains": [
|
||||
"geosite:geolocation-!cn"
|
||||
]
|
||||
},
|
||||
{
|
||||
"address": "114.114.114.114",
|
||||
"port": 53,
|
||||
"domains": [
|
||||
"geosite:cn"
|
||||
]
|
||||
},
|
||||
"8.8.8.8",
|
||||
"223.5.5.5"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
- [@v2ray/geoip](https://github.com/v2ray/geoip)
|
||||
- [@v2ray/domain-list-community](https://github.com/v2ray/domain-list-community)
|
||||
- [@felixonmars/dnsmasq-china-list](https://github.com/felixonmars/dnsmasq-china-list)
|
||||
- [@cokebar/gfwlist2dnsmasq](https://github.com/cokebar/gfwlist2dnsmasq)
|
||||
- [@wongsyrone/domain-block-list](https://github.com/wongsyrone/domain-block-list)
|
||||
- [@ConnersHua/Profiles](https://github.com/ConnersHua/Profiles/tree/master)
|
||||
- [@GeQ1an/Rules](https://github.com/GeQ1an/Rules/tree/master/QuantumultX)
|
||||
- [@lhie1/Rules](https://github.com/lhie1/Rules/tree/master)
|
||||
- [MaxMind 免费 IP](https://dev.maxmind.com/geoip/geoip2/geolite2/)
|
||||
|
||||
Reference in New Issue
Block a user