Skip to content

Instantly share code, notes, and snippets.

@CHIZI-0618
Last active April 28, 2024 06:14
Show Gist options
  • Star 56 You must be signed in to star a gist
  • Fork 17 You must be signed in to fork a gist
  • Save CHIZI-0618/fc3495cd15b3ab3d53c77872ebece8ae to your computer and use it in GitHub Desktop.
Save CHIZI-0618/fc3495cd15b3ab3d53c77872ebece8ae to your computer and use it in GitHub Desktop.
sing-box 带有 Proxy Providers 的客户端配置示例
{
"log": {
"level": "info",
"output": "sing-box.log",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "cloudflare",
"address": "tls://1.1.1.1",
"detour": "Proxy"
},
{
"tag": "fakedns",
"address": "fakeip"
},
{
"tag": "local",
"address": "https://1.12.12.12/dns-query",
"detour": "direct"
},
{
"tag": "block",
"address": "rcode://success"
}
],
"rules": [
// https://github.com/SagerNet/sing-box/releases/tag/v1.2.2
{
"outbound": "any",
"server": "local",
"disable_cache": true
},
{
"clash_mode": "Global",
"server": "cloudflare"
},
{
"clash_mode": "Direct",
"server": "local"
},
{
"geosite": "category-ads-all",
"server": "block"
},
{
"geosite": [
"cn",
"apple@cn",
"category-games@cn",
"private"
],
"domain_keyword": "ntp",
"server": "local"
},
{
"query_type": [
"A",
"AAAA"
],
"server": "fakedns"
}
],
"fakeip": {
"enabled": true,
"inet4_range": "198.18.0.0/15",
"inet6_range": "fc00::/18"
},
"independent_cache": true,
"strategy": "prefer_ipv4"
},
"inbounds": [
{
"type": "mixed",
"tag": "mixed-in",
"listen": "::",
"listen_port": 1080,
"sniff": true
// "domain_strategy": "prefer_ipv4" // remove this line if you want to resolve the domain remotely (if the server is not sing-box, UDP may not work due to wrong behavior).
// "set_system_proxy": false
},
// {
// "type": "tun",
// "tag": "tun-in",
// "interface_name": "tun3",
// "inet4_address": "172.19.0.1/30",
// "inet6_address": "fdfe:dcba:9876::1/126",
// "stack": "system",
// "auto_route": true,
// "strict_route": true,
// "sniff": true,
// "platform": {
// "http_proxy": {
// "enabled": true,
// "server": "127.0.0.1",
// "server_port": 1080
// }
// }
// },
{
"type": "tproxy",
"tag": "tproxy-in",
"listen": "::",
"listen_port": 1536,
"sniff": true
}
],
// 这里的 proviedrs 需要使用 https://github.com/PuerNya/sing-box/tree/outbound-providers
"outbound_providers": [
{
"tag": "singbox-http",
"type": "http",
"download_url": "sing-box 远程配置文件链接",
"download_interval": "24h",
"path": "singbox-http.json",
"healthcheck_interval": "1h",
"download_ua": "sing-box",
"download_detour": "Proxy"
},
{
"tag": "clash-http",
"type": "http",
"download_url": "clash 订阅链接",
"download_interval": "24h",
"path": "clash.yaml",
"healthcheck_interval": "1h",
"download_ua": "Clash.Meta",
"download_detour": "Proxy"
},
{
"tag": "base64-http",
"type": "http",
"download_url": "base64 订阅链接",
"download_interval": "24h",
"path": "base64.txt",
"healthcheck_interval": "1h",
"download_ua": "v2ray",
"download_detour": "Proxy"
},
// 上述所有格式订阅均支持本地文件,自动识别
{
"tag": "file",
"type": "file",
"path": "./singbox-file.json",
// "path": "./clash-file.yaml",
// "path": "./base64-file.txt",
"healthcheck_interval": "1h"
}
],
"outbounds": [
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
},
{
"type": "selector",
"tag": "Proxy",
"providers": [
"singbox-http",
"clash-http",
"base64-http",
"file"
],
// "use_all_providers": true,
"outbounds": [
"direct"
],
"default": "direct"
// "includes": [
// "^HK\\..+",
// "^TW\\..+",
// "^SG\\..+",
// ],
// "excludes": "^JP\\..+",
// "types": [
// "shadowsocks",
// "vmess",
// "vless",
// ],
// "ports": [
// "80",
// "2000:4000",
// "2000:",
// ":4000"
// ]
}
],
"route": {
"rules": [
{
"type": "logical",
"mode": "or",
"rules":[
{
"port":53
},
{
"protocol": "dns"
}
],
"outbound": "dns-out"
},
{
"clash_mode": "Global",
"outbound": "Proxy"
},
{
"clash_mode": "Direct",
"outbound": "direct"
},
{
"geosite": "category-ads-all",
"outbound": "block"
},
{
"geosite": [
"apple@cn",
"category-games@cn",
"private",
"cn"
],
"outbound":"direct"
},
{
"geoip": [
"cn",
"private"
],
"outbound": "direct"
}
],
// "auto_detect_interface": true,
// Tun 一般需要开启
// "default_mark": 233,
// Tproxy 可能用到
"find_process": true,
"final": "Proxy"
},
"experimental": {
"clash_api": {
"external_controller": "127.0.0.1:9999",
"external_ui": "dashboard",
"store_selected": true,
"store_fakeip": true
}
}
}
{
"log": {
"level": "info",
"output": "sing-box.log",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "cloudflare",
"address": "tls://1.1.1.1",
"detour": "Proxy"
},
{
"tag": "fakedns",
"address": "fakeip"
},
{
"tag": "local",
"address": "https://1.12.12.12/dns-query",
"detour": "direct"
},
{
"tag": "block",
"address": "rcode://success"
}
],
"rules": [
// https://github.com/SagerNet/sing-box/releases/tag/v1.2.2
{
"outbound": "any",
"server": "local",
"disable_cache": true
},
{
"clash_mode": "Global",
"server": "cloudflare"
},
{
"clash_mode": "Direct",
"server": "local"
},
{
"rule_set": [
// "block-local",
"category-ads-all"
],
"server": "block",
"disable_cache": true
},
{
"rule_set": [
// "direct-local",
"apple@cn",
"category-games@cn",
"private",
"cn-domain"
],
"server": "local"
},
{
"query_type": [
"A",
"AAAA"
],
"server": "fakedns"
}
],
"fakeip": {
"enabled": true,
"inet4_range": "198.18.0.0/15",
"inet6_range": "fc00::/18"
},
"independent_cache": true,
"strategy": "prefer_ipv4"
},
"inbounds": [
{
"type": "mixed",
"tag": "mixed-in",
"listen": "::",
"listen_port": 1080,
"sniff": true
// "domain_strategy": "prefer_ipv4" // remove this line if you want to resolve the domain remotely (if the server is not sing-box, UDP may not work due to wrong behavior).
// "set_system_proxy": false
},
// {
// "type": "tun",
// "tag": "tun-in",
// "interface_name": "tun3",
// "inet4_address": "172.19.0.1/30",
// "inet6_address": "fdfe:dcba:9876::1/126",
// "stack": "system",
// "auto_route": true,
// "strict_route": true,
// "sniff": true,
// "platform": {
// "http_proxy": {
// "enabled": true,
// "server": "127.0.0.1",
// "server_port": 1080
// }
// }
// },
{
"type": "tproxy",
"tag": "tproxy-in",
"listen": "::",
"listen_port": 1536,
"sniff": true
}
],
// 这里的 proviedrs 需要使用 https://github.com/PuerNya/sing-box/tree/outbound-providers
"outbound_providers": [
{
"tag": "singbox-http",
"type": "http",
"download_url": "sing-box 远程配置文件链接",
"download_interval": "24h",
"path": "singbox-http.json",
"healthcheck_interval": "1h",
"download_ua": "sing-box",
"download_detour": "Proxy"
},
{
"tag": "clash-http",
"type": "http",
"download_url": "clash 订阅链接",
"download_interval": "24h",
"path": "clash.yaml",
"healthcheck_interval": "1h",
"download_ua": "Clash.Meta",
"download_detour": "Proxy"
},
{
"tag": "base64-http",
"type": "http",
"download_url": "base64 订阅链接",
"download_interval": "24h",
"path": "base64.txt",
"healthcheck_interval": "1h",
"download_ua": "v2ray",
"download_detour": "Proxy"
},
// 上述所有格式订阅均支持本地文件,自动识别
{
"tag": "file",
"type": "file",
"path": "./singbox-file.json",
// "path": "./clash-file.yaml",
// "path": "./base64-file.txt",
"healthcheck_interval": "1h"
}
],
"outbounds": [
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
},
{
"type": "selector",
"tag": "Proxy",
"providers": [
"singbox-http",
"clash-http",
"base64-http",
"file"
],
// "use_all_providers": true,
"outbounds": [
"direct"
],
"default": "direct"
// "includes": [
// "^HK\\..+",
// "^TW\\..+",
// "^SG\\..+",
// ],
// "excludes": "^JP\\..+",
// "types": [
// "shadowsocks",
// "vmess",
// "vless",
// ],
// "ports": [
// "80",
// "2000:4000",
// "2000:",
// ":4000"
// ]
}
],
"route": {
"rule_set": [
// {
// "type": "local",
// "tag": "block-local",
// "format": "source",
// "path": "./block.json"
// },
// {
// "type": "local",
// "tag": "direct-local",
// "format": "source",
// "path": "./direct.json"
// },
{
"type": "remote",
"tag": "category-ads-all",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-ads-all.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"type": "remote",
"tag": "apple@cn",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-apple@cn.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"type": "remote",
"tag": "category-games@cn",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games@cn.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"type": "remote",
"tag": "private",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-private.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"type": "remote",
"tag": "cn-domain",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-cn.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"type": "remote",
"tag": "cn-ip",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
"download_detour": "Proxy",
"update_interval": "24h"
}
],
"rules": [
{
"type": "logical",
"mode": "or",
"rules":[
{
"port":53
},
{
"protocol": "dns"
}
],
"outbound": "dns-out"
},
{
"clash_mode": "Global",
"outbound": "Proxy"
},
{
"clash_mode": "Direct",
"outbound": "direct"
},
{
"rule_set": [
// "block-local",
"category-ads-all"
],
"outbound": "block"
},
{
"rule_set": [
// "direct-local",
"apple@cn",
"category-games@cn",
"private",
"cn-domain"
],
"outbound": "direct"
},
{
"rule_set": "cn-ip",
"outbound": "direct"
},
{
"ip_is_private": true,
"outbound": "direct"
}
],
// "auto_detect_interface": true,
// Tun 一般需要开启
// "default_mark": 233,
// Tproxy 可能用到
"find_process": true,
"final": "Proxy"
},
"experimental": {
"cache_file": {
"enabled": true,
"store_fakeip": true
},
"clash_api": {
"external_controller": "0.0.0.0:9999",
"secret": "singbox",
"external_ui": "dashboard"
}
}
}
{
"log": {
"level": "info",
"output": "sing-box.log",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "cloudflare",
"address": "tls://1.1.1.1",
"detour": "Proxy"
},
{
"tag": "fakedns",
"address": "fakeip"
},
{
"tag": "local",
"address": "https://1.12.12.12/dns-query",
"detour": "direct"
},
{
"tag": "block",
"address": "rcode://success"
}
],
"rules": [
// https://github.com/SagerNet/sing-box/releases/tag/v1.2.2
{
"outbound": "any",
"server": "local",
"disable_cache": true
},
{
"clash_mode": "Global",
"server": "cloudflare"
},
{
"clash_mode": "Direct",
"server": "local"
},
{
"geosite": "category-ads-all",
"server": "block"
},
{
"geosite": [
"cn",
"apple@cn",
"category-games@cn",
"private"
],
"domain_keyword": "ntp",
"server": "local"
},
{
"query_type": [
"A",
"AAAA"
],
"server": "fakedns"
}
],
"fakeip": {
"enabled": true,
"inet4_range": "198.18.0.0/15",
"inet6_range": "fc00::/18"
},
"independent_cache": true,
"strategy": "prefer_ipv4"
},
"inbounds": [
{
"type": "mixed",
"tag": "mixed-in",
"listen": "::",
"listen_port": 1080,
"sniff": true
// "domain_strategy": "prefer_ipv4" // remove this line if you want to resolve the domain remotely (if the server is not sing-box, UDP may not work due to wrong behavior).
// "set_system_proxy": false
},
// {
// "type": "tun",
// "tag": "tun-in",
// "interface_name": "tun3",
// "inet4_address": "172.19.0.1/30",
// "inet6_address": "fdfe:dcba:9876::1/126",
// "stack": "system",
// "auto_route": true,
// "strict_route": true,
// "sniff": true,
// "platform": {
// "http_proxy": {
// "enabled": true,
// "server": "127.0.0.1",
// "server_port": 1080
// }
// }
// },
{
"type": "tproxy",
"tag": "tproxy-in",
"listen": "::",
"listen_port": 1536,
"sniff": true
}
],
// 这里的 proviedrs 需要使用 https://github.com/qjebbs/sing-box
"providers": [
{
"tag": "provider1",
"url": "base64 订阅链接1",
"interval": "24h",
"cache_file": "provider1.txt",
"download_detour": "direct"
},
{
"tag": "provider2",
"url": "base64 订阅链接2",
"interval": "18h",
"cache_file": "provider2.txt",
"download_detour": "direct",
"exclude": "官网|剩余|到期|流量"
},
{
"tag": "provider3",
"url": "base64 订阅链接3",
"interval": "12h",
"cache_file": "provider3.txt",
"download_detour": "direct",
"include": "IEPL|专线"
}
],
"outbounds": [
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
},
{
"type": "selector",
"tag": "Proxy",
"providers": [
"provider1",
"provider2",
"provider3"
],
"outbounds": [
"direct"
]
}
],
"route": {
"rules": [
{
"type": "logical",
"mode": "or",
"rules":[
{
"port":53
},
{
"protocol": "dns"
}
],
"outbound": "dns-out"
},
{
"clash_mode": "Global",
"outbound": "Proxy"
},
{
"clash_mode": "Direct",
"outbound": "direct"
},
{
"geosite": "category-ads-all",
"outbound": "block"
},
{
"geosite": [
"apple@cn",
"category-games@cn",
"private",
"cn"
],
"outbound":"direct"
},
{
"geoip": [
"cn",
"private"
],
"outbound": "direct"
}
],
// "auto_detect_interface": true,
// Tun 一般需要开启
// "default_mark": 233,
// Tproxy 可能用到
"find_process": true,
"final": "Proxy"
},
"experimental": {
"clash_api": {
"external_controller": "127.0.0.1:9999",
"external_ui": "dashboard",
"store_selected": true,
"store_fakeip": true
}
}
}
{
"log": {
"level": "info",
"output": "sing-box.log",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "cloudflare",
"address": "tls://1.1.1.1",
"detour": "Proxy"
},
{
"tag": "fakedns",
"address": "fakeip"
},
{
"tag": "local",
"address": "https://1.12.12.12/dns-query",
"detour": "direct"
},
{
"tag": "block",
"address": "rcode://success"
}
],
"rules": [
// https://github.com/SagerNet/sing-box/releases/tag/v1.2.2
{
"outbound": "any",
"server": "local",
"disable_cache": true
},
{
"clash_mode": "Global",
"server": "cloudflare"
},
{
"clash_mode": "Direct",
"server": "local"
},
{
"rule_set": [
// "block-local",
"category-ads-all"
],
"server": "block",
"disable_cache": true
},
{
"rule_set": [
// "direct-local",
"apple@cn",
"category-games@cn",
"private",
"cn-domain"
],
"server": "local"
},
{
"query_type": [
"A",
"AAAA"
],
"server": "fakedns"
}
],
"fakeip": {
"enabled": true,
"inet4_range": "198.18.0.0/15",
"inet6_range": "fc00::/18"
},
"independent_cache": true,
"strategy": "prefer_ipv4"
},
"inbounds": [
{
"type": "mixed",
"tag": "mixed-in",
"listen": "::",
"listen_port": 1080,
"sniff": true
// "domain_strategy": "prefer_ipv4" // remove this line if you want to resolve the domain remotely (if the server is not sing-box, UDP may not work due to wrong behavior).
// "set_system_proxy": false
},
// {
// "type": "tun",
// "tag": "tun-in",
// "interface_name": "tun3",
// "inet4_address": "172.19.0.1/30",
// "inet6_address": "fdfe:dcba:9876::1/126",
// "stack": "system",
// "auto_route": true,
// "strict_route": true,
// "sniff": true,
// "platform": {
// "http_proxy": {
// "enabled": true,
// "server": "127.0.0.1",
// "server_port": 1080
// }
// }
// },
{
"type": "tproxy",
"tag": "tproxy-in",
"listen": "::",
"listen_port": 1536,
"sniff": true
}
],
// 这里的 proviedrs 需要使用 https://github.com/qjebbs/sing-box
"providers": [
{
"tag": "provider1",
"url": "base64 订阅链接1",
"interval": "24h",
"cache_file": "provider1.txt",
"download_detour": "direct"
},
{
"tag": "provider2",
"url": "base64 订阅链接2",
"interval": "18h",
"cache_file": "provider2.txt",
"download_detour": "direct",
"exclude": "官网|剩余|到期|流量"
},
{
"tag": "provider3",
"url": "base64 订阅链接3",
"interval": "12h",
"cache_file": "provider3.txt",
"download_detour": "direct",
"include": "IEPL|专线"
}
],
"outbounds": [
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
},
{
"type": "selector",
"tag": "Proxy",
"providers": [
"provider1",
"provider2",
"provider3"
],
"outbounds": [
"direct"
]
}
],
"route": {
"rule_set": [
// {
// "type": "local",
// "tag": "block-local",
// "format": "source",
// "path": "./block.json"
// },
// {
// "type": "local",
// "tag": "direct-local",
// "format": "source",
// "path": "./direct.json"
// },
{
"type": "remote",
"tag": "category-ads-all",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-ads-all.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"type": "remote",
"tag": "apple@cn",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-apple@cn.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"type": "remote",
"tag": "category-games@cn",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games@cn.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"type": "remote",
"tag": "private",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-private.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"type": "remote",
"tag": "cn-domain",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-cn.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"type": "remote",
"tag": "cn-ip",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
"download_detour": "Proxy",
"update_interval": "24h"
}
],
"rules": [
{
"type": "logical",
"mode": "or",
"rules":[
{
"port":53
},
{
"protocol": "dns"
}
],
"outbound": "dns-out"
},
{
"clash_mode": "Global",
"outbound": "Proxy"
},
{
"clash_mode": "Direct",
"outbound": "direct"
},
{
"rule_set": [
// "block-local",
"category-ads-all"
],
"outbound": "block"
},
{
"rule_set": [
// "direct-local",
"apple@cn",
"category-games@cn",
"private",
"cn-domain"
],
"outbound": "direct"
},
{
"rule_set": "cn-domain",
"outbound": "direct"
},
{
"rule_set": "cn-ip",
"outbound": "direct"
},
{
"ip_is_private": true,
"outbound": "direct"
}
],
// "auto_detect_interface": true,
// Tun 一般需要开启
// "default_mark": 233,
// Tproxy 可能用到
"find_process": true,
"final": "Proxy"
},
"experimental": {
"cache_file": {
"enabled": true,
"store_fakeip": true
},
"clash_api": {
"external_controller": "0.0.0.0:9999",
"secret": "singbox",
"external_ui": "dashboard"
}
}
}
{
"log": {
"level": "info",
"output": "sing-box.log",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "cloudflare",
"address": "tls://1.1.1.1",
"detour": "Proxy"
},
{
"tag": "fakedns",
"address": "fakeip"
},
{
"tag": "local",
"address": "https://1.12.12.12/dns-query",
"detour": "direct"
},
{
"tag": "block",
"address": "rcode://success"
}
],
"rules": [
// https://github.com/SagerNet/sing-box/releases/tag/v1.2.2
{
"outbound": "any",
"server": "local",
"disable_cache": true
},
{
"clash_mode": "Global",
"server": "cloudflare"
},
{
"clash_mode": "Direct",
"server": "local"
},
{
"geosite": "category-ads-all",
"server": "block"
},
{
"geosite": [
"cn",
"apple@cn",
"category-games@cn",
"private"
],
"domain_keyword": "ntp",
"server": "local"
},
{
"query_type": [
"A",
"AAAA"
],
"server": "fakedns"
}
],
"fakeip": {
"enabled": true,
"inet4_range": "198.18.0.0/15",
"inet6_range": "fc00::/18"
},
"independent_cache": true,
"strategy": "prefer_ipv4"
},
"inbounds": [
{
"type": "mixed",
"tag": "mixed-in",
"listen": "::",
"listen_port": 1080,
"sniff": true
// "domain_strategy": "prefer_ipv4" // remove this line if you want to resolve the domain remotely (if the server is not sing-box, UDP may not work due to wrong behavior).
// "set_system_proxy": false
},
// {
// "type": "tun",
// "tag": "tun-in",
// "interface_name": "tun3",
// "inet4_address": "172.19.0.1/30",
// "inet6_address": "fdfe:dcba:9876::1/126",
// "stack": "system",
// "auto_route": true,
// "strict_route": true,
// "sniff": true,
// "platform": {
// "http_proxy": {
// "enabled": true,
// "server": "127.0.0.1",
// "server_port": 1080
// }
// }
// },
{
"type": "tproxy",
"tag": "tproxy-in",
"listen": "::",
"listen_port": 1536,
"sniff": true
}
],
// 这里的 proxyproviedrs 需要使用 https://github.com/rnetx/sing-box/tree/next
"outbound_providers": [
{
"tag": "Provider",
"url": "sing-box 远程配置文件链接",
"headers": {
"User-Agent": "sing-box,clash.meta,v2ray"
},
"update_interval": "12h",
"detour": "direct"
// "actions": [
// {
// "type": "filter",
// "rules": [
// "剩余",
// "过期",
// "更多"
// ]
// }
// ]
}
],
"outbounds": [
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
},
{
"type": "selector",
"tag": "Proxy",
"outbounds": [
"Provider",
"direct"
]
}
],
"route": {
"rules": [
{
"type": "logical",
"mode": "or",
"rules":[
{
"port":53
},
{
"protocol": "dns"
}
],
"outbound": "dns-out"
},
{
"clash_mode": "Global",
"outbound": "Proxy"
},
{
"clash_mode": "Direct",
"outbound": "direct"
},
{
"geosite": "category-ads-all",
"outbound": "block"
},
{
"geosite": [
"apple@cn",
"category-games@cn",
"private",
"cn"
],
"outbound":"direct"
},
{
"geoip": [
"cn",
"private"
],
"outbound": "direct"
}
],
// "auto_detect_interface": true,
// Tun 一般需要开启
// "default_mark": 233,
// Tproxy 可能用到
"find_process": true,
"final": "Proxy"
},
"experimental": {
"clash_api": {
"external_controller": "127.0.0.1:9999",
"external_ui": "dashboard",
"store_selected": true,
"store_fakeip": true
}
}
}
{
"log": {
"level": "info",
"output": "sing-box.log",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "cloudflare",
"address": "tls://1.1.1.1",
"detour": "Proxy"
},
{
"tag": "fakedns",
"address": "fakeip"
},
{
"tag": "local",
"address": "https://1.12.12.12/dns-query",
"detour": "direct"
},
{
"tag": "block",
"address": "rcode://success"
}
],
"rules": [
// https://github.com/SagerNet/sing-box/releases/tag/v1.2.2
{
"outbound": "any",
"server": "local",
"disable_cache": true
},
{
"clash_mode": "Global",
"server": "cloudflare"
},
{
"clash_mode": "Direct",
"server": "local"
},
{
"rule_set": [
// "block-local",
"category-ads-all"
],
"server": "block",
"disable_cache": true
},
{
"rule_set": [
// "direct-local",
"apple@cn",
"category-games@cn",
"private",
"cn-domain"
],
"server": "local"
},
{
"query_type": [
"A",
"AAAA"
],
"server": "fakedns"
}
],
"fakeip": {
"enabled": true,
"inet4_range": "198.18.0.0/15",
"inet6_range": "fc00::/18"
},
"independent_cache": true,
"strategy": "prefer_ipv4"
},
"inbounds": [
{
"type": "mixed",
"tag": "mixed-in",
"listen": "::",
"listen_port": 1080,
"sniff": true
// "domain_strategy": "prefer_ipv4" // remove this line if you want to resolve the domain remotely (if the server is not sing-box, UDP may not work due to wrong behavior).
// "set_system_proxy": false
},
// {
// "type": "tun",
// "tag": "tun-in",
// "interface_name": "tun3",
// "inet4_address": "172.19.0.1/30",
// "inet6_address": "fdfe:dcba:9876::1/126",
// "stack": "system",
// "auto_route": true,
// "strict_route": true,
// "sniff": true,
// "platform": {
// "http_proxy": {
// "enabled": true,
// "server": "127.0.0.1",
// "server_port": 1080
// }
// }
// },
{
"type": "tproxy",
"tag": "tproxy-in",
"listen": "::",
"listen_port": 1536,
"sniff": true
}
],
// 这里的 proxyproviedrs 需要使用 https://github.com/rnetx/sing-box/tree/next
"outbound_providers": [
{
"tag": "Provider",
"url": "sing-box 远程配置文件链接",
"headers": {
"User-Agent": "sing-box,clash.meta,v2ray"
},
"update_interval": "12h",
"detour": "direct"
// "actions": [
// {
// "type": "filter",
// "rules": [
// "剩余",
// "过期",
// "更多"
// ]
// }
// ]
}
],
"outbounds": [
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
},
{
"type": "selector",
"tag": "Proxy",
"outbounds": [
"Provider",
"direct"
]
}
],
"route": {
"rule_set": [
// {
// "type": "local",
// "tag": "block-local",
// "format": "source",
// "path": "./block.json"
// },
// {
// "type": "local",
// "tag": "direct-local",
// "format": "source",
// "path": "./direct.json"
// },
{
"type": "remote",
"tag": "category-ads-all",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-ads-all.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"type": "remote",
"tag": "apple@cn",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-apple@cn.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"type": "remote",
"tag": "category-games@cn",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games@cn.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"type": "remote",
"tag": "private",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-private.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"type": "remote",
"tag": "cn-domain",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-cn.srs",
"download_detour": "Proxy",
"update_interval": "24h"
},
{
"type": "remote",
"tag": "cn-ip",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
"download_detour": "Proxy",
"update_interval": "24h"
}
],
"rules": [
{
"type": "logical",
"mode": "or",
"rules":[
{
"port":53
},
{
"protocol": "dns"
}
],
"outbound": "dns-out"
},
{
"clash_mode": "Global",
"outbound": "Proxy"
},
{
"clash_mode": "Direct",
"outbound": "direct"
},
{
"rule_set": [
// "block-local",
"category-ads-all"
],
"outbound": "block"
},
{
"rule_set": [
// "direct-local",
"apple@cn",
"category-games@cn",
"private",
"cn-domain"
],
"outbound": "direct"
},
{
"rule_set": "cn-ip",
"outbound": "direct"
},
{
"ip_is_private": true,
"outbound": "direct"
}
],
// "auto_detect_interface": true,
// Tun 一般需要开启
// "default_mark": 233,
// Tproxy 可能用到
"find_process": true,
"final": "Proxy"
},
"experimental": {
"cache_file": {
"enabled": true,
"store_fakeip": true
},
"clash_api": {
"external_controller": "0.0.0.0:9999",
"secret": "singbox",
"external_ui": "dashboard"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment