{ "$schema": "https://sing-box.sagernet.org/schema.json", "log": { "disabled": false, "level": "info", "timestamp": true }, "dns": { "servers": [ { "type": "hosts", "tag": "hosts", "predefined": { "dns.alidns.com": [ "223.5.5.5", "223.6.6.6", "2400:3200::1", "2400:3200:baba::1" ], "dns.google": ["8.8.8.8", "8.8.4.4", "2001:4860:4860::8888", "2001:4860:4860::8844"] } }, { "tag": "google", "type": "https", "server": "dns.google", "domain_resolver": "hosts", "detour": "✈️proxy" }, { "tag": "ali", "type": "https", "server": "dns.alidns.com", "domain_resolver": "hosts" }, { "tag": "fakeip", "type": "fakeip", "inet4_range": "198.18.0.0/15", "inet6_range": "fc00::/18" } ], "rules": [ { "rule_set": [ "adblock", "BlockHttpDNS" ], "action": "predefined", "rcode": "NXDOMAIN" }, { "query_type": ["SVCB", "HTTPS", "PTR"], "action": "predefined", "rcode": "NOERROR" }, { "domain_suffix": ["your-domain.com", "your-ddns.org"], "action": "route", "server": "ali" }, { "clash_mode": "Direct", "action": "route", "server": "ali" }, { "clash_mode": "Global", "query_type": ["A", "AAAA"], "action": "route", "server": "fakeip", "rewrite_ttl": 1 }, { "rule_set": ["trackerslist", "private", "fakeipfilter-cn", "apple-cn", "microsoft-cn", "games-cn", "cn"], "action": "route", "server": "ali" }, { "rule_set": "fakeipfilter-!cn", "action": "route", "server": "google" }, { "rule_set": "proxy", "query_type": ["A", "AAAA"], "server": "fakeip", "rewrite_ttl": 1 }, { "query_type": ["A", "AAAA"], "action": "evaluate", "server": "google", "client_subnet": "223.5.5.0/24", "timeout": "1s" }, { "match_response": true, "rule_set": "cnip", "server": "ali" }, { "query_type": ["A", "AAAA"], "server": "fakeip", "rewrite_ttl": 1 } ], "final": "google", "reverse_mapping": true, "timeout": "10s", "cache_capacity": 4096, "optimistic": { "enabled": true, "timeout": "5m0s" } }, "http_clients": [ { "tag": "default", "version": 2, "stream_receive_window": 0, "connection_receive_window": 0 } ], "inbounds": [ { "type": "tun", "tag": "tun-in", "address": [ "172.19.0.1/30", "fdfe:dcba:9876::1/126" ], "stack": "mixed", "auto_route": true, "strict_route": true, "mtu": 1400, "udp_timeout": "5m", "udp_mapping": "endpoint_independent", "udp_filtering": "endpoint_independent", "udp_nat_max": 0, "platform": { "http_proxy": { "enabled": true, "server": "127.0.0.1", "server_port": 7890 } } }, { "type": "mixed", "listen": "127.0.0.1", "listen_port": 7890 } ], "route": { "rules": [ { "port": 53, "action": "hijack-dns" }, { "network": "icmp", "action": "resolve" }, { "ip_cidr": [ "0.0.0.0/8" ], "action": "reject" }, { "ip_cidr": ["10.7.0.1/32"], "action": "route", "outbound": "direct" }, { "type": "logical", "mode": "and", "rules": [ { "ip_version": 6 }, { "ip_cidr": [ "fc00::/18" ], "invert": true }, { "default_interface_address": ["2000::/3"], "invert": true } ], "action": "reject", "no_drop": true }, { "network": "icmp", "action": "route", "outbound": "direct" }, { "ip_cidr": ["100.64.0.0/10", "fd7a:115c:a1e0::/48"], "action": "route", "outbound": "ts-ep" }, { "rule_set": "privateip", "action": "route", "outbound": "direct" }, { "rule_set": ["adblock", "BlockHttpDNS"], "action": "reject", "no_drop": true }, { "port": 993, "rule_set": "cnip", "action": "reject" }, { "domain_suffix": ["your-domain.com", "your-ddns.org"], "action": "route", "outbound": "direct" }, { "domain_suffix": ["googleapis.cn", "xn--ngstr-lra8j.com"], "action": "route", "outbound": "🔍Google" }, { "rule_set": "cnip", "action": "route", "outbound": "direct" }, { "type": "logical", "mode": "or", "rules": [ { "domain_suffix": "push.apple.com" }, { "rule_set": "telegramip" } ], "invert": true, "action": "sniff", "timeout": "100ms" }, { "protocol": "dns", "action": "hijack-dns" }, { "clash_mode": "Global", "action": "route", "outbound": "✈️proxy" }, { "clash_mode": "Direct", "action": "route", "outbound": "direct" }, { "protocol": "ntp", "action": "route", "outbound": "direct" }, { "rule_set": ["trackerslist", "private", "apple-cn", "microsoft-cn", "games-cn", "cn"], "action": "route", "outbound": "direct" }, { "type": "logical", "mode": "or", "rules": [ { "protocol": [ "quic", "stun" ] }, { "network": "udp", "port": 443 } ], "action": "reject", "no_drop": true }, { "rule_set": "google", "action": "route", "outbound": "🔍Google" }, { "rule_set": "meta", "action": "route", "outbound": "🔗Meta" }, { "rule_set": "spotify", "action": "route", "outbound": "🎶Spotify" }, { "rule_set": ["fakeipfilter-!cn", "youtube", "netflix", "telegramip"], "action": "route", "outbound": "✈️proxy" }, { "rule_set": "proxy", "action": "route", "outbound": "✈️proxy" }, { "action": "resolve" }, { "rule_set": ["privateip", "cnip"], "action": "route", "outbound": "direct" } ], "auto_detect_interface": true, "default_domain_resolver": "ali", "default_http_client": "default", "final": "🕸️final", "rule_set": [ { "type": "remote", "tag": "BlockHttpDNS", "url": "https://ghfast.top/https://raw.githubusercontent.com/senshinya/singbox_ruleset/main/rule/BlockHttpDNS/BlockHttpDNS.srs", "update_interval": "48h0m0s" }, { "type": "remote", "tag": [ "fakeipfilter-cn", "fakeipfilter-!cn", "meta", "google" ], "url": "https://ghfast.top/https://raw.githubusercontent.com/wuziwei/sing-box-config-template/main/rules/{tag}.srs", "update_interval": "48h0m0s" }, { "type": "remote", "tag": [ "trackerslist", "private", "privateip", "apple-cn", "microsoft-cn", "games-cn", "cn", "cnip", "proxy", "telegramip", "youtube", "netflix", "spotify" ], "url": "https://ghfast.top/https://raw.githubusercontent.com/DustinWin/ruleset_geodata/sing-box-ruleset/{tag}.srs", "update_interval": "48h0m0s" }, { "type": "remote", "tag": "adblock", "url": "https://ghfast.top/https://github.com/217heidai/adblockfilters/releases/download/rule/adblocksingboxlite.srs", "update_interval": "48h0m0s" } ] }, "endpoints": [ { "type": "tailscale", "tag": "ts-ep", "auth_key": "input your auth_key", "state_directory": "tailscale.state", "advertise_routes": [ "192.168.1.0/24" ], "ephemeral": false, "accept_routes": true, "advertise_exit_node": true, "udp_timeout": "5m" } ], "outbounds": [ { "tag": "✈️proxy", "type": "selector", "outbounds": [ "⚡️Lantency", "🌎Manual-select", "🇰🇷SK", "🇨🇦CA", "🇯🇵JP", "🇺🇸US" ], "default": "⚡️Lantency" }, { "tag": "🌎Manual-select", "type": "selector", "outbounds": [ "🇯🇵JP1-hy2", "🇯🇵JP2-hy2", "🇯🇵JP3-hy2", "🇺🇸US1-hy2-mlb", "🇺🇸US1-hy2", "🇺🇸US2-hy2", "🇺🇸US3-hy2", "🇨🇦CA1-hy2", "🇨🇦CA2-hy2", "🇨🇦CA3-hy2", "🇰🇷SK1-hy2", "🇰🇷SK2-hy2", "🇰🇷SK3-hy2", "🇯🇵JP1-hy2-v6", "🇯🇵JP2-hy2-v6", "🇯🇵JP3-hy2-v6", "🇺🇸US1-hy2-v6", "🇺🇸US2-hy2-v6", "🇺🇸US3-hy2-v6", "🇨🇦CA1-hy2-v6", "🇨🇦CA2-hy2-v6", "🇨🇦CA3-hy2-v6", "🇰🇷SK1-hy2-v6", "🇰🇷SK2-hy2-v6", "🇰🇷SK3-hy2-v6" ], "default": "🇰🇷SK3-hy2" }, { "tag": "🇺🇸US", "type": "urltest", "outbounds": ["🇺🇸US1-hy2-mlb", "🇺🇸US1-hy2", "🇺🇸US2-hy2", "🇺🇸US3-hy2", "🇺🇸US1-hy2-v6", "🇺🇸US2-hy2-v6", "🇺🇸US3-hy2-v6"], "url": "https://www.gstatic.com/generate_204", "interval": "15m", "tolerance": 35, "idle_timeout": "15m0s", "interrupt_exist_connections": false }, { "tag": "🇯🇵JP", "type": "urltest", "outbounds": ["🇯🇵JP1-hy2", "🇯🇵JP2-hy2", "🇯🇵JP3-hy2", "🇯🇵JP1-hy2-v6", "🇯🇵JP2-hy2-v6", "🇯🇵JP3-hy2-v6"], "url": "https://www.gstatic.com/generate_204", "interval": "15m", "tolerance": 35, "idle_timeout": "15m0s", "interrupt_exist_connections": false }, { "tag": "🇨🇦CA", "type": "urltest", "outbounds": ["🇨🇦CA1-hy2", "🇨🇦CA2-hy2", "🇨🇦CA3-hy2", "🇨🇦CA1-hy2-v6", "🇨🇦CA2-hy2-v6", "🇨🇦CA3-hy2-v6"], "url": "https://www.gstatic.com/generate_204", "interval": "15m", "tolerance": 35, "idle_timeout": "15m0s", "interrupt_exist_connections": false }, { "tag": "🇰🇷SK", "type": "urltest", "outbounds": ["🇰🇷SK1-hy2", "🇰🇷SK2-hy2", "🇰🇷SK3-hy2", "🇰🇷SK1-hy2-v6", "🇰🇷SK2-hy2-v6", "🇰🇷SK3-hy2-v6"], "url": "https://www.gstatic.com/generate_204", "interval": "15m", "tolerance": 35, "idle_timeout": "15m0s", "interrupt_exist_connections": false }, { "tag": "🔍Google", "type": "selector", "outbounds": ["🇺🇸US", "⚡️Lantency", "🌎Manual-select", "🇯🇵JP", "🇰🇷SK", "🇨🇦CA"], "default": "🇺🇸US" }, { "tag": "🔗Meta", "type": "selector", "outbounds": ["🇰🇷SK", "🇨🇦CA", "🇯🇵JP", "🇺🇸US"], "default": "🇺🇸US" }, { "tag": "🎶Spotify", "type": "selector", "outbounds": ["direct", "🇰🇷SK", "🇨🇦CA", "🇯🇵JP", "🇺🇸US"], "default": "🇯🇵JP" }, { "tag": "⚡️Lantency", "type": "urltest", "outbounds": ["🇯🇵JP3-hy2", "🇯🇵JP3-hy2-v6", "🇺🇸US1-hy2-mlb", "🇺🇸US1-hy2", "🇺🇸US1-hy2-v6", "🇨🇦CA3-hy2", "🇨🇦CA3-hy2-v6", "🇰🇷SK3-hy2", "🇰🇷SK3-hy2-v6"], "url": "https://www.gstatic.com/generate_204", "interval": "15m", "tolerance": 35, "idle_timeout": "15m0s", "interrupt_exist_connections": false }, { "tag": "🕸️final", "type": "selector", "outbounds": ["⚡️Lantency", "🇰🇷SK", "🇨🇦CA", "🇯🇵JP", "🇺🇸US", "direct"], "default": "⚡️Lantency" }, { "tag": "GLOBAL", "type": "selector", "outbounds": ["⚡️Lantency", "🇰🇷SK", "🇨🇦CA", "🇯🇵JP", "🇺🇸US"], "default": "⚡️Lantency" }, { "tag": "direct", "type": "direct" }, { "type": "hysteria2", "tag": "🇯🇵JP1-hy2", "server": "your server ip/domain", "server_port": 2053, "up_mbps": 35, "down_mbps": 35, "password": "inpout your server pw", "obfs": { "type": "salamander", "password": "inpout your server pw" }, "tls": { "enabled": true, "server_name": "inpout your server domain", "alpn": ["h3"] } } ], "services": [ { "type": "api", "listen": "127.0.0.1", "listen_port": 9091, "secret": "", "dashboard": { "enabled": true, "http_client": "default", "download_url": "https://ghfast.top/https://github.com/SagerNet/sing-box-dashboard/archive/refs/heads/gh-pages.zip" } } ], "experimental": { "clash_api": { "external_controller": "127.0.0.1:9090", "external_ui": "ui", "external_ui_download_detour": "✈️proxy" }, "cache_file": { "enabled": true, "store_fakeip": true, "store_dns": true } } }