mirror of
https://github.com/Dichgrem/singbox-example.git
synced 2025-08-02 01:49:31 -04:00
init:start
This commit is contained in:
62
client/example-rule/dns-rule-leak.yaml
Normal file
62
client/example-rule/dns-rule-leak.yaml
Normal file
@ -0,0 +1,62 @@
|
||||
{
|
||||
"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" },
|
||||
{ "clash_mode": "Default", "server": "google" },
|
||||
{
|
||||
"type": "logical",
|
||||
"mode": "and",
|
||||
"rules":
|
||||
[
|
||||
{ "rule_set": "geosite-geolocation-!cn", "invert": true },
|
||||
{ "rule_set": "geoip-cn" },
|
||||
],
|
||||
"server": "local",
|
||||
},
|
||||
],
|
||||
},
|
||||
"route":
|
||||
{
|
||||
"rule_set":
|
||||
[
|
||||
{
|
||||
"type": "remote",
|
||||
"tag": "geosite-geolocation-cn",
|
||||
"format": "binary",
|
||||
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs",
|
||||
},
|
||||
{
|
||||
"type": "remote",
|
||||
"tag": "geosite-geolocation-!cn",
|
||||
"format": "binary",
|
||||
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs",
|
||||
},
|
||||
{
|
||||
"type": "remote",
|
||||
"tag": "geoip-cn",
|
||||
"format": "binary",
|
||||
"url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
|
||||
},
|
||||
],
|
||||
},
|
||||
"experimental":
|
||||
{
|
||||
"cache_file": { "enabled": true, "store_rdrc": true },
|
||||
"clash_api": { "default_mode": "Enhanced" },
|
||||
},
|
||||
}
|
||||
|
61
client/example-rule/dns-rule.yaml
Normal file
61
client/example-rule/dns-rule.yaml
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"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", "invert": true },
|
||||
{ "rule_set": "geoip-cn" },
|
||||
],
|
||||
"server": "google",
|
||||
"client_subnet": "114.114.114.114/24", #Any China client IP address
|
||||
},
|
||||
],
|
||||
},
|
||||
"route":
|
||||
{
|
||||
"rule_set":
|
||||
[
|
||||
{
|
||||
"type": "remote",
|
||||
"tag": "geosite-geolocation-cn",
|
||||
"format": "binary",
|
||||
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs",
|
||||
},
|
||||
{
|
||||
"type": "remote",
|
||||
"tag": "geosite-geolocation-!cn",
|
||||
"format": "binary",
|
||||
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs",
|
||||
},
|
||||
{
|
||||
"type": "remote",
|
||||
"tag": "geoip-cn",
|
||||
"format": "binary",
|
||||
"url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
|
||||
},
|
||||
],
|
||||
},
|
||||
"experimental":
|
||||
{
|
||||
"cache_file": { "enabled": true, "store_rdrc": true },
|
||||
"clash_api": { "default_mode": "Enhanced" },
|
||||
},
|
||||
}
|
||||
|
48
client/example-rule/fakeip.yaml
Normal file
48
client/example-rule/fakeip.yaml
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"dns":
|
||||
{
|
||||
"servers":
|
||||
[
|
||||
{ "tag": "google", "address": "tls://8.8.8.8" },
|
||||
{ "tag": "local", "address": "223.5.5.5", "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,
|
||||
},
|
||||
"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": "direct", "tag": "direct" },
|
||||
{ "type": "dns", "tag": "dns-out" },
|
||||
],
|
||||
"route":
|
||||
{
|
||||
"rules":
|
||||
[
|
||||
{ "protocol": "dns", "outbound": "dns-out" },
|
||||
{ "geoip": ["private"], "outbound": "direct" },
|
||||
],
|
||||
"auto_detect_interface": true,
|
||||
},
|
||||
} #
|
||||
|
53
client/example-rule/route-rule.yaml
Normal file
53
client/example-rule/route-rule.yaml
Normal file
@ -0,0 +1,53 @@
|
||||
{
|
||||
"outbounds":
|
||||
[
|
||||
{ "type": "direct", "tag": "direct" },
|
||||
{ "type": "block", "tag": "block" },
|
||||
],
|
||||
"route":
|
||||
{
|
||||
"rules":
|
||||
[
|
||||
{
|
||||
"type": "logical",
|
||||
"mode": "or",
|
||||
"rules": [{ "protocol": "dns" }, { "port": 53 }],
|
||||
"outbound": "dns",
|
||||
},
|
||||
{ "ip_is_private": true, "outbound": "direct" },
|
||||
{ "clash_mode": "Direct", "outbound": "direct" },
|
||||
{ "clash_mode": "Global", "outbound": "default" },
|
||||
{
|
||||
"type": "logical",
|
||||
"mode": "or",
|
||||
"rules":
|
||||
[
|
||||
{ "port": 853 },
|
||||
{ "network": "udp", "port": 443 },
|
||||
{ "protocol": "stun" },
|
||||
],
|
||||
"outbound": "block",
|
||||
},
|
||||
{
|
||||
"rule_set": ["geoip-cn", "geosite-geolocation-cn"],
|
||||
"outbound": "direct",
|
||||
},
|
||||
],
|
||||
"rule_set":
|
||||
[
|
||||
{
|
||||
"type": "remote",
|
||||
"tag": "geoip-cn",
|
||||
"format": "binary",
|
||||
"url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
|
||||
},
|
||||
{
|
||||
"type": "remote",
|
||||
"tag": "geosite-geolocation-cn",
|
||||
"format": "binary",
|
||||
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs",
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
|
36
client/example-rule/tun-ipv4+ipv6.yaml
Normal file
36
client/example-rule/tun-ipv4+ipv6.yaml
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"dns":
|
||||
{
|
||||
"servers":
|
||||
[
|
||||
{ "tag": "google", "address": "tls://8.8.8.8" },
|
||||
{ "tag": "local", "address": "223.5.5.5", "detour": "direct" },
|
||||
],
|
||||
"rules": [{ "outbound": "any", "server": "local" }],
|
||||
},
|
||||
"inbounds":
|
||||
[
|
||||
{
|
||||
"type": "tun",
|
||||
"inet4_address": "172.19.0.1/30",
|
||||
"inet6_address": "fdfe:dcba:9876::1/126",
|
||||
"auto_route": true,
|
||||
"strict_route": false,
|
||||
},
|
||||
],
|
||||
"outbounds": [
|
||||
# // ...
|
||||
{ "type": "direct", "tag": "direct" },
|
||||
{ "type": "dns", "tag": "dns-out" },
|
||||
],
|
||||
"route":
|
||||
{
|
||||
"rules":
|
||||
[
|
||||
{ "protocol": "dns", "outbound": "dns-out" },
|
||||
{ "geoip": ["private"], "outbound": "direct" },
|
||||
],
|
||||
"auto_detect_interface": true,
|
||||
},
|
||||
} #
|
||||
|
36
client/example-rule/tun-ipv4only.yaml
Normal file
36
client/example-rule/tun-ipv4only.yaml
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"dns":
|
||||
{
|
||||
"servers":
|
||||
[
|
||||
{ "tag": "google", "address": "tls://8.8.8.8" },
|
||||
{ "tag": "local", "address": "223.5.5.5", "detour": "direct" },
|
||||
],
|
||||
"rules": [{ "outbound": "any", "server": "local" }],
|
||||
"strategy": "ipv4_only",
|
||||
},
|
||||
"inbounds":
|
||||
[
|
||||
{
|
||||
"type": "tun",
|
||||
"inet4_address": "172.19.0.1/30",
|
||||
"auto_route": true,
|
||||
"strict_route": false,
|
||||
},
|
||||
],
|
||||
"outbounds": [
|
||||
#// ...
|
||||
{ "type": "direct", "tag": "direct" },
|
||||
{ "type": "dns", "tag": "dns-out" },
|
||||
],
|
||||
"route":
|
||||
{
|
||||
"rules":
|
||||
[
|
||||
{ "protocol": "dns", "outbound": "dns-out" },
|
||||
{ "geoip": ["private"], "outbound": "direct" },
|
||||
],
|
||||
"auto_detect_interface": true,
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user