json
{
"log": {
"level": "info",
"output": "console"
},
"inbounds": [
{
"type": "tun",
"tag": "tun-in",
"interface_name": "singbox-tun",
"inet4_address": "172.19.0.1/30",
"mtu": 9000,
"auto_route": true,
"strict_route": false,
"stack": "system"
}
],
"outbounds": [
{
"type": "hy2",
"tag": "hy2-out",
"server": "your-server.com", // 替换为你的服务器地址
"server_port": 443, // 替换为你的服务器端口
"uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // 替换为你的UUID
"up_mbps": 100,
"down_mbps": 100,
"tls": {
"enabled": true,
"server_name": "your-sni.com", // 替换为你的SNI
"insecure": false
}
},
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
}
],
"route": {
"auto_detect_interface": true,
"rules": [
{
"type": "field",
"outbound": "block",
"domain_category": [
"ads"
]
},
{
"type": "field",
"outbound": "direct",
"domain_suffix": [
"cn",
"com.cn",
"net.cn",
"org.cn"
],
"ip_cidr": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"224.0.0.0/4",
"240.0.0.0/4",
"255.255.255.255/32",
"1.0.1.0/24",
"1.0.2.0/23",
"1.0.8.0/21",
"1.1.0.0/24",
"1.1.2.0/23",
"1.1.4.0/22",
"1.1.8.0/21",
"1.2.0.0/23",
"1.2.2.0/24",
"1.2.4.0/22",
"1.2.8.0/21"
// 可根据需要补充更多国内IP段
]
},
{
"type": "field",
"outbound": "hy2-out",
"network": "tcp,udp"
}
]
},
"dns": {
"servers": [
{
"tag": "domestic",
"address": "223.5.5.5",
"address_strategy": "ipv4_only",
"detour": "direct"
},
{
"tag": "domestic2",
"address": "119.29.29.29",
"address_strategy": "ipv4_only",
"detour": "direct"
},
{
"tag": "remote",
"address": "8.8.8.8",
"address_strategy": "ipv4_only",
"detour": "hy2-out"
}
],
"rules": [
{
"type": "field",
"outbound": "block",
"domain_category": [
"ads"
]
},
{
"type": "field",
"server": "domestic",
"domain_suffix": [
"cn",
"com.cn",
"net.cn",
"org.cn"
]
},
{
"type": "field",
"server": "remote",
"domain_suffix": [
"com",
"net",
"org",
"io",
"app"
]
}
],
"strategy": "ipv4_only",
"disable_cache": false
}
}