洋芋笔记

sing-box 客户端配置文件

使用国内外分流模式,实际使用按照需求自行修改

{
  "log": {
    "level": "info",
    "timestamp": true
  },
  "dns": {
    "servers": [
      {
        "type": "udp",
        "tag": "google",
        "detour": "out",
        "server": "8.8.8.8"
      },
      {
        "type": "udp",
        "tag": "ali",
        "server": "223.5.5.5"
      }
    ],
    "rules": [
      {
        "rule_set": "geosite-geolocation-cn",
        "server": "ali",
        "strategy": "ipv4_only",
        "rewrite_ttl": 3600
      },
      {
        "server": "google",
        "strategy": "ipv4_only",
        "rewrite_ttl": 3600
      }
    ]
  },
  "inbounds": [
    {
      "type": "tun",
      "mtu": 1280,
      "address": "172.19.0.1/30",
      "auto_route": true,
      "strict_route": true,
      "route_exclude_address": [
        "192.168.0.0/16",
        "fc00::/7"
      ],
      "exclude_package": [
        "com.tencent.qqlive",
        "com.tencent.mm",
        "com.sie.mp",
        "com.sonelli.juicessh",
        "air.tv.douyu.android"
      ]
    }
  ],
  "outbounds": [
      //你的出站代理
    {
      "type": "direct",
      "tag": "direct"
    }
  ],
  "route": {
    "rules": [
      {
        "action": "sniff"
      },
      {
        "action": "resolve"
      },
      {
        "protocol": "dns",
        "action": "hijack-dns"
      },
      {
        "network": "udp",
        "port": [
          8443,
          443
        ],
        "action": "reject"
      },
      {
        "protocol": "quic",
        "action": "reject"
      },
      {
        "rule_set": "geoip-cn",
        "outbound": "direct"
      },
      {
        "rule_set": "geosite-geolocation-cn",
        "outbound": "direct"
      },
      {
        "ip_is_private": true,
        "outbound": "direct"
      }
    ],
    "rule_set": [
      {
        "type": "remote",
        "tag": "geoip-cn",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs"
      },
      {
        "type": "remote",
        "tag": "geosite-geolocation-cn",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs"
      }
    ],
    "auto_detect_interface": true,
    "default_domain_resolver": "google"
  },
  "experimental": {
    "cache_file": {
      "enabled": true,
      "store_rdrc": true
    }
  }
}

vmess出站示例

{
      "type": "vmess",
      "tag": "out",
      "server": "你的ip",
      "server_port": 8080,
      "uuid": "你的UUID",
      "security": "auto",
      "authenticated_length": true,
      "network": "tcp",
      "transport": {
        "type": "http",
        "path": "/home",
        "host": ["test.ustc.edu.cn","www.speedtest.cn"],
      }
    },

hy2出站代理,端口跳跃

{
      "type": "hysteria2",
      "tag": "out",
      "server": "你的hy2 ip",
      "server_port": 0,
      "server_ports": "40000:50000",
      "hop_interval": "5s",
      "down_mbps": 40,
      "password": "你的hy2密码",
      "tls": {
        "enabled": true,
        "server_name": "你的hy2域名",
        "insecure": true
      }
    },

#sing-box