1
0
mirror of https://github.com/nitezs/sub2sing-box.git synced 2024-12-23 14:04:41 -05:00

update: readme, template

This commit is contained in:
Nite07 2024-03-13 02:02:17 +08:00
parent 4c2ea5896b
commit c3ed392900
9 changed files with 1024 additions and 241 deletions

View File

@ -37,7 +37,7 @@ jobs:
${{ secrets.DOCKER_HUB_USERNAME }}/sub2sing-box
ghcr.io/${{ github.repository }}
- name: Prepare tags and build args
- name: Prepare args
id: prep
run: |
if [[ "${{ github.event_name }}" == 'workflow_dispatch' ]]; then
@ -49,7 +49,7 @@ jobs:
if [[ "$GITHUB_REF" == 'refs/tags/'* ]]; then
VERSION=$TAG_NAME
fi
echo "version=${VERSION}" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_ENV
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
@ -59,7 +59,7 @@ jobs:
with:
context: .
file: ./Dockerfile
build-args: version=${{ steps.prep.outputs.version }}
build-args: version=${{ env.version }}
push: true
platforms: linux/amd64,linux/arm,linux/arm64
tags: ${{ steps.meta.outputs.tags }}

View File

@ -13,6 +13,8 @@ builds:
- "386"
ldflags:
- -s -w -X sub2sing-box/main.Version={{ .Version }}
flags:
- -trimpath
no_unique_dist_dir: true
binary: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
archives:

View File

@ -40,9 +40,22 @@ Flags:
- `data`: Base64 编码的 JSON 字符串,包含以下字段:
- `subscription`: []string
- `proxy`: []string
- `delete`: string
- `rename`: string
- `template`: string
- `delete`: string 可选
- `rename`: string 可选
- `template`: map[string]string 可选
示例
```
{
"subscription": ["url1", "url2"],
"proxy": ["p1", "p2"],
"delete": "reg",
"template": "t",
"rename": {
"text": "replaceTo"
}
}
```
## Template
@ -56,3 +69,7 @@ Template 中使用 `<all-proxy-tags>` 指明节点插入位置,例如
"interrupt_exist_connections": true
},
```
## Docker
`docker run -p 8080:8080 nite07/sub2sing-box`

View File

@ -14,7 +14,7 @@ func RunServer(port uint16) {
r.GET("/convert", handler.Convert)
fmt.Println("Server is running on port ", port)
fmt.Println("Server is running on port", port)
err := r.Run(":" + strconv.Itoa(int(port)))
if err != nil {
fmt.Println("Run server failed: ", err)

View File

@ -0,0 +1,247 @@
{
"log": {
"level": "info",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "google",
"address": "tls://8.8.8.8"
},
{
"tag": "local",
"address": "https://223.5.5.5/dns-query",
"detour": "direct"
},
{
"tag": "remote",
"address": "fakeip"
}
],
"rules": [
{
"outbound": "any",
"server": "local"
},
{
"clash_mode": "Direct",
"server": "local"
},
{
"clash_mode": "Global",
"server": "google"
},
{
"rule_set": "geosite-geolocation-cn",
"server": "local"
},
{
"query_type": ["A", "AAAA"],
"server": "remote"
}
],
"fakeip": {
"enabled": true,
"inet4_range": "198.18.0.0/15",
"inet6_range": "fc00::/18"
},
"independent_cache": true
},
"route": {
"rule_set": [
{
"tag": "geosite-geolocation-cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-geolocation-!cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geoip-cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-category-ads-all",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-ads-all.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-microsoft",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-microsoft.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-bilibili",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-bilibili.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-bahamut",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-bahamut.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-category-games@cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games@cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-category-games",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games.srs",
"download_detour": "节点选择"
}
],
"rules": [
{
"type": "logical",
"mode": "or",
"rules": [
{
"protocol": "dns"
},
{
"port": 53
}
],
"outbound": "dns-out"
},
{
"ip_is_private": true,
"outbound": "direct"
},
{
"rule_set": ["geoip-cn", "geosite-geolocation-cn"],
"outbound": "direct"
},
{
"rule_set": "geosite-category-ads-all",
"outbound": "Ads"
},
{
"rule_set": "geosite-microsoft",
"outbound": "Microsoft"
},
{
"rule_set": "geosite-bilibili",
"outbound": "Bilibili"
},
{
"rule_set": "geosite-category-games@cn",
"outbound": "Games(中国)"
},
{
"rule_set": "geosite-category-games",
"outbound": "Games(全球)"
},
{
"rule_set": "geosite-bahamut",
"outbound": "Bahamut"
}
],
"final": "节点选择",
"auto_detect_interface": true
},
"inbounds": [
{
"type": "tun",
"inet4_address": "172.19.0.1/30",
"inet6_address": "fdfe:dcba:9876::1/126",
"auto_route": true,
"strict_route": true,
"sniff": true,
"sniff_override_destination": false
}
],
"outbounds": [
{
"type": "selector",
"tag": "节点选择",
"outbounds": ["<all-proxy-tags>", "direct"],
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Ads",
"outbounds": ["direct", "block"],
"default": "block",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Microsoft",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "节点选择",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Bilibili",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "direct",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Games(全球)",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "节点选择",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Games(中国)",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "direct",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Bahamut",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "节点选择",
"interrupt_exist_connections": true
},
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"experimental": {
"clash_api": {
"external_controller": "127.0.0.1:9090",
"external_ui": "./ui",
"external_ui_download_detour": "节点选择"
}
}
}

View File

@ -0,0 +1,266 @@
{
"log": {
"level": "info",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "google",
"address": "tls://8.8.8.8"
},
{
"tag": "local",
"address": "https://223.5.5.5/dns-query",
"detour": "direct"
},
{
"tag": "remote",
"address": "fakeip"
}
],
"rules": [
{
"outbound": "any",
"server": "local"
},
{
"clash_mode": "Direct",
"server": "local"
},
{
"clash_mode": "Global",
"server": "google"
},
{
"rule_set": "geosite-geolocation-cn",
"server": "local"
},
{
"type": "logical",
"mode": "and",
"rules": [
{
"rule_set": "geosite-geolocation-!cn"
},
{
"rule_set": "geoip-cn"
}
],
"server": "google",
"client_subnet": "114.114.114.114"
},
{
"query_type": ["A", "AAAA"],
"server": "remote"
}
],
"fakeip": {
"enabled": true,
"inet4_range": "198.18.0.0/15",
"inet6_range": "fc00::/18"
},
"independent_cache": true
},
"route": {
"rule_set": [
{
"tag": "geosite-geolocation-cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-geolocation-!cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geoip-cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-category-ads-all",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-ads-all.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-microsoft",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-microsoft.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-bilibili",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-bilibili.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-bahamut",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-bahamut.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-category-games@cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games@cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-category-games",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games.srs",
"download_detour": "节点选择"
}
],
"rules": [
{
"type": "logical",
"mode": "or",
"rules": [
{
"protocol": "dns"
},
{
"port": 53
}
],
"outbound": "dns-out"
},
{
"ip_is_private": true,
"outbound": "direct"
},
{
"rule_set": ["geoip-cn", "geosite-geolocation-cn"],
"outbound": "direct"
},
{
"rule_set": "geosite-category-ads-all",
"outbound": "Ads"
},
{
"rule_set": "geosite-microsoft",
"outbound": "Microsoft"
},
{
"rule_set": "geosite-bilibili",
"outbound": "Bilibili"
},
{
"rule_set": "geosite-category-games@cn",
"outbound": "Games(中国)"
},
{
"rule_set": "geosite-category-games",
"outbound": "Games(全球)"
},
{
"rule_set": "geosite-bahamut",
"outbound": "Bahamut"
}
],
"final": "节点选择",
"auto_detect_interface": true
},
"inbounds": [
{
"type": "tun",
"inet4_address": "172.19.0.1/30",
"inet6_address": "fdfe:dcba:9876::1/126",
"auto_route": true,
"strict_route": true,
"sniff": true,
"sniff_override_destination": false
}
],
"outbounds": [
{
"type": "selector",
"tag": "节点选择",
"outbounds": ["<all-proxy-tags>", "direct"],
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Ads",
"outbounds": ["direct", "block"],
"default": "block",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Microsoft",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "节点选择",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Bilibili",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "direct",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Games(全球)",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "节点选择",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Games(中国)",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "direct",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Bahamut",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "节点选择",
"interrupt_exist_connections": true
},
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"experimental": {
"cache_file": {
"enabled": true,
"store_rdrc": true
},
"clash_api": {
"default_mode": "Enhanced",
"external_controller": "127.0.0.1:9090",
"external_ui": "./ui",
"external_ui_download_detour": "节点选择"
}
}
}

View File

@ -1,234 +0,0 @@
{
"log": {
"level": "info",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "google",
"address": "tls://8.8.8.8"
},
{
"tag": "local",
"address": "https://223.5.5.5/dns-query",
"detour": "direct"
},
{
"tag": "remote",
"address": "fakeip"
}
],
"rules": [
{
"outbound": "any",
"server": "local"
},
{
"query_type": ["A", "AAAA"],
"server": "remote"
}
],
"fakeip": {
"enabled": true,
"inet4_range": "198.18.0.0/15",
"inet6_range": "fc00::/18"
},
"independent_cache": true
},
"route": {
"rule_set": [
{
"tag": "geosite-geolocation-cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geoip-cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-category-ads-all",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-ads-all.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-microsoft",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-microsoft.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-bilibili",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-bilibili.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-bahamut",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-bahamut.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-category-games@cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games@cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-category-games",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games.srs",
"download_detour": "节点选择"
}
],
"rules": [
{
"type": "logical",
"mode": "or",
"rules": [
{
"protocol": "dns"
},
{
"port": 53
}
],
"outbound": "dns-out"
},
{
"protocol": "dns",
"outbound": "dns-out"
},
{
"ip_is_private": true,
"outbound": "direct"
},
{
"rule_set": ["geoip-cn", "geosite-geolocation-cn"],
"outbound": "direct"
},
{
"rule_set": "geosite-category-ads-all",
"outbound": "Ads"
},
{
"rule_set": "geosite-microsoft",
"outbound": "Microsoft"
},
{
"rule_set": "geosite-bilibili",
"outbound": "Bilibili"
},
{
"rule_set": "geosite-category-games@cn",
"outbound": "Games(中国)"
},
{
"rule_set": "geosite-category-games",
"outbound": "Games(全球)"
},
{
"rule_set": "geosite-bahamut",
"outbound": "Bahamut"
}
],
"final": "节点选择",
"auto_detect_interface": true
},
"inbounds": [
{
"type": "tun",
"inet4_address": "172.19.0.1/30",
"inet6_address": "fdfe:dcba:9876::1/126",
"auto_route": true,
"strict_route": true
}
],
"outbounds": [
{
"type": "selector",
"tag": "节点选择",
"outbounds": ["<all-proxy-tags>", "direct"],
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Ads",
"outbounds": ["direct", "block"],
"default": "block",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Microsoft",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "节点选择",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Bilibili",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "direct",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Games(全球)",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "节点选择",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Games(中国)",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "direct",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Bahamut",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "节点选择",
"interrupt_exist_connections": true
},
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"experimental": {
"cache_file": {
"enabled": true,
"path": "cache.db"
},
"clash_api": {
"external_controller": "127.0.0.1:9090",
"external_ui": "./ui",
"external_ui_download_detour": "节点选择"
}
}
}

View File

@ -0,0 +1,233 @@
{
"log": {
"level": "info",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "google",
"address": "tls://8.8.8.8"
},
{
"tag": "local",
"address": "https://223.5.5.5/dns-query",
"detour": "direct"
}
],
"rules": [
{
"outbound": "any",
"server": "local"
},
{
"clash_mode": "Direct",
"server": "local"
},
{
"clash_mode": "Global",
"server": "google"
},
{
"rule_set": "geosite-geolocation-cn",
"server": "local"
}
]
},
"route": {
"rule_set": [
{
"tag": "geosite-geolocation-cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-geolocation-!cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geoip-cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-category-ads-all",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-ads-all.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-microsoft",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-microsoft.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-bilibili",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-bilibili.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-bahamut",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-bahamut.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-category-games@cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games@cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-category-games",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games.srs",
"download_detour": "节点选择"
}
],
"rules": [
{
"type": "logical",
"mode": "or",
"rules": [
{
"protocol": "dns"
},
{
"port": 53
}
],
"outbound": "dns-out"
},
{
"ip_is_private": true,
"outbound": "direct"
},
{
"rule_set": ["geoip-cn", "geosite-geolocation-cn"],
"outbound": "direct"
},
{
"rule_set": "geosite-category-ads-all",
"outbound": "Ads"
},
{
"rule_set": "geosite-microsoft",
"outbound": "Microsoft"
},
{
"rule_set": "geosite-bilibili",
"outbound": "Bilibili"
},
{
"rule_set": "geosite-category-games@cn",
"outbound": "Games(中国)"
},
{
"rule_set": "geosite-category-games",
"outbound": "Games(全球)"
},
{
"rule_set": "geosite-bahamut",
"outbound": "Bahamut"
}
],
"final": "节点选择",
"auto_detect_interface": true
},
"inbounds": [
{
"type": "tun",
"inet4_address": "172.19.0.1/30",
"inet6_address": "fdfe:dcba:9876::1/126",
"auto_route": true,
"strict_route": false,
"sniff": true,
"sniff_override_destination": false
}
],
"outbounds": [
{
"type": "selector",
"tag": "节点选择",
"outbounds": ["<all-proxy-tags>", "direct"],
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Ads",
"outbounds": ["direct", "block"],
"default": "block",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Microsoft",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "节点选择",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Bilibili",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "direct",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Games(全球)",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "节点选择",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Games(中国)",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "direct",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Bahamut",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "节点选择",
"interrupt_exist_connections": true
},
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"experimental": {
"clash_api": {
"external_controller": "127.0.0.1:9090",
"external_ui": "./ui",
"external_ui_download_detour": "节点选择"
}
}
}

View File

@ -0,0 +1,252 @@
{
"log": {
"level": "info",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "google",
"address": "tls://8.8.8.8"
},
{
"tag": "local",
"address": "https://223.5.5.5/dns-query",
"detour": "direct"
}
],
"rules": [
{
"outbound": "any",
"server": "local"
},
{
"clash_mode": "Direct",
"server": "local"
},
{
"clash_mode": "Global",
"server": "google"
},
{
"rule_set": "geosite-geolocation-cn",
"server": "local"
},
{
"type": "logical",
"mode": "and",
"rules": [
{
"rule_set": "geosite-geolocation-!cn"
},
{
"rule_set": "geoip-cn"
}
],
"server": "google",
"client_subnet": "114.114.114.114"
}
]
},
"route": {
"rule_set": [
{
"tag": "geosite-geolocation-cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-geolocation-!cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geoip-cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-category-ads-all",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-ads-all.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-microsoft",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-microsoft.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-bilibili",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-bilibili.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-bahamut",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-bahamut.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-category-games@cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games@cn.srs",
"download_detour": "节点选择"
},
{
"tag": "geosite-category-games",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games.srs",
"download_detour": "节点选择"
}
],
"rules": [
{
"type": "logical",
"mode": "or",
"rules": [
{
"protocol": "dns"
},
{
"port": 53
}
],
"outbound": "dns-out"
},
{
"ip_is_private": true,
"outbound": "direct"
},
{
"rule_set": ["geoip-cn", "geosite-geolocation-cn"],
"outbound": "direct"
},
{
"rule_set": "geosite-category-ads-all",
"outbound": "Ads"
},
{
"rule_set": "geosite-microsoft",
"outbound": "Microsoft"
},
{
"rule_set": "geosite-bilibili",
"outbound": "Bilibili"
},
{
"rule_set": "geosite-category-games@cn",
"outbound": "Games(中国)"
},
{
"rule_set": "geosite-category-games",
"outbound": "Games(全球)"
},
{
"rule_set": "geosite-bahamut",
"outbound": "Bahamut"
}
],
"final": "节点选择",
"auto_detect_interface": true
},
"inbounds": [
{
"type": "tun",
"inet4_address": "172.19.0.1/30",
"inet6_address": "fdfe:dcba:9876::1/126",
"auto_route": true,
"strict_route": false,
"sniff": true,
"sniff_override_destination": false
}
],
"outbounds": [
{
"type": "selector",
"tag": "节点选择",
"outbounds": ["<all-proxy-tags>", "direct"],
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Ads",
"outbounds": ["direct", "block"],
"default": "block",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Microsoft",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "节点选择",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Bilibili",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "direct",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Games(全球)",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "节点选择",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Games(中国)",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "direct",
"interrupt_exist_connections": true
},
{
"type": "selector",
"tag": "Bahamut",
"outbounds": ["节点选择", "<all-proxy-tags>", "direct"],
"default": "节点选择",
"interrupt_exist_connections": true
},
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"experimental": {
"cache_file": {
"enabled": true,
"store_rdrc": true
},
"clash_api": {
"default_mode": "Enhanced",
"external_controller": "127.0.0.1:9090",
"external_ui": "./ui",
"external_ui_download_detour": "节点选择"
}
}
}