# >>=====================================<<
# ||                                     ||
# ||      ██████╗  ██████╗  ██████╗      ||
# ||     ██╔════╝ ██╔════╝ ██╔════╝      ||
# ||     ███████╗ ███████╗ ███████╗      ||
# ||     ██╔═══██╗██╔═══██╗██╔═══██╗     ||
# ||     ╚██████╔╝╚██████╔╝╚██████╔╝     ||
# ||      ╚═════╝  ╚═════╝  ╚═════╝      ||
# ||                                     ||
# >>=====================================<<
# 名称: OneTouch 一键连 v3.2
# 日期: 2025 年 4 月 24 日
# 地址: https://github.com/666OS
# 频道: https://t.me/Pinched666

PProviders: &PProviders {type: http, interval: 86400, proxy: DIRECT, health-check: {enable: true, url: 'https://www.gstatic.com/generate_204', interval: 300}, filter: '^(?!.*(群|邀请|返利|循环|官网|客服|网站|网址|获取|订阅|流量|到期|机场|下次|版本|官址|备用|过期|已用|联系|邮箱|工单|贩卖|通知|倒卖|防止|国内|地址|频道|无法|说明|使用|提示|特别|访问|支持|教程|关注|更新|作者|加入|USE|USED|TOTAL|EXPIRE|EMAIL|Panel|Channel|Author))'}
UrlTest: &UrlTest {type: url-test, interval: 60, tolerance: 20, lazy: true, url: 'https://www.gstatic.com/generate_204', disable-udp: false, timeout: 2000, max-failed-times: 3, hidden: true, include-all: true}
FallBack: &FallBack {type: fallback, interval: 60, lazy: true, url: 'https://www.gstatic.com/generate_204', disable-udp: false, timeout: 2000, max-failed-times: 3, hidden: false}
FilterHK: &FilterHK '^(?=.*(?i)(港|🇭🇰|HK|Hong|HKG))(?!.*(排除1|排除2|5x)).*$'
FilterSG: &FilterSG '^(?=.*(?i)(坡|🇸🇬|SG|Sing|SIN|XSP))(?!.*(排除1|排除2|5x)).*$'
FilterJP: &FilterJP '^(?=.*(?i)(日|🇯🇵|JP|Japan|NRT|HND|KIX|CTS|FUK))(?!.*(排除1|排除2|5x)).*$'
FilterKR: &FilterKR '^(?=.*(?i)(韩|🇰🇷|韓|首尔|南朝鲜|KR|KOR|Korea|South))(?!.*(排除1|排除2|5x)).*$'
FilterUS: &FilterUS '^(?=.*(?i)(美|🇺🇸|US|USA|JFK|LAX|ORD|ATL|DFW|SFO|MIA|SEA|IAD))(?!.*(排除1|排除2|5x)).*$'
FilterTW: &FilterTW '^(?=.*(?i)(台|🇼🇸|🇹🇼|TW|tai|TPE|TSA|KHH))(?!.*(排除1|排除2|5x)).*$'
FilterEU: &FilterEU '^(?=.*(?i)(奥|比|保|克罗地亚|塞|捷|丹|爱沙|芬|法|德|希|匈|爱尔|意|拉|立|卢|马其它|荷|波|葡|罗|斯洛伐|斯洛文|西|瑞|英|🇧🇪|🇨🇿|🇩🇰|🇫🇮|🇫🇷|🇩🇪|🇮🇪|🇮🇹|🇱🇹|🇱🇺|🇳🇱|🇵🇱|🇸🇪|🇬🇧|CDG|FRA|AMS|MAD|BCN|FCO|MUC|BRU))(?!.*(排除1|排除2|5x)).*$'
FilterOther: &FilterOther '^(?!.*(DIRECT|美|港|坡|台|新|日|韩|奥|比|保|克罗地亚|塞|捷|丹|爱沙|芬|法|德|希|匈|爱尔|意|拉|立|卢|马其它|荷|波|葡|罗|斯洛伐|斯洛文|西|瑞|英|🇭🇰|🇼🇸|🇹🇼|🇸🇬|🇯🇵|🇰🇷|🇺🇸|🇬🇧|🇦🇹|🇧🇪|🇨🇿|🇩🇰|🇫🇮|🇫🇷|🇩🇪|🇮🇪|🇮🇹|🇱🇹|🇱🇺|🇳🇱|🇵🇱|🇸🇪|HK|TW|SG|JP|KR|US|GB|CDG|FRA|AMS|MAD|BCN|FCO|MUC|BRU|HKG|TPE|TSA|KHH|SIN|XSP|NRT|HND|KIX|CTS|FUK|JFK|LAX|ORD|ATL|DFW|SFO|MIA|SEA|IAD|LHR|LGW))'
FilterAll: &FilterAll '^(?!.*(DIRECT|群|邀请|返利|循环|官网|客服|网站|网址|获取|订阅|流量|到期|机场|下次|版本|官址|备用|过期|已用|联系|邮箱|工单|贩卖|通知|倒卖|防止|国内|地址|频道|无法|说明|使用|提示|特别|访问|支持|教程|关注|更新|作者|加入|USE|USED|TOTAL|EXPIRE|EMAIL|Panel|Channel|Author))'
SelectFB: &SelectFB {type: select, proxies: [故障转移, 香港自动, 台湾自动, 新加坡自动, 日本自动, 韩国自动, 美国自动]}
SelectUS: &SelectUS {type: select, proxies: [美国自动, 台湾自动, 新加坡自动, 日本自动, 韩国自动]}
SelectOne: &SelectOne {type: select, proxies: [一键连, 故障转移, 香港自动, 台湾自动, 新加坡自动, 日本自动, 韩国自动, 美国自动]}

# 填写订阅,名称不能重复
proxy-providers:
  机场A: {<<: *PProviders, url: '机场订阅地址', override: {additional-prefix: '[A] '}}
  机场B: {<<: *PProviders, url: '机场订阅地址', override: {additional-prefix: '[B] '}}

mode: rule
port: 7890
socks-port: 7891
redir-port: 7892
mixed-port: 7893
tproxy-port: 7895
ipv6: true
allow-lan: true
unified-delay: true
tcp-concurrent: true
log-level: warning
bind-address: "*"
find-process-mode: 'off'
global-client-fingerprint: chrome
keep-alive-interval: 15
keep-alive-idle: 600
authentication:
  - s71557:s71557
skip-auth-prefixes:
  - 192.168.1.0/24
  - 192.168.31.0/24
  - 192.168.100.0/24
  - 127.0.0.1/8
  
external-ui-url: https://github.com/Zephyruso/zashboard/releases/latest/download/dist.zip
external-ui-name: zashboard
external-ui: ui
external-controller: 0.0.0.0:9090
secret: s71557

profile:
  store-selected: true
  store-fake-ip: true
  
sniffer:
  enable: true
  override-destination: false
  force-dns-mapping: true
  parse-pure-ip: true

tun:
  enable: true
  stack: mixed
  dns-hijack:
    - "any:53"
    - "tcp://any:53"
  auto-route: true
  auto-redirect: true
  auto-detect-interface: true
    
dns:
  enable: true
  ipv6: true
  enhanced-mode: fake-ip
  fake-ip-range: 198.18.0.1/16
  default-nameserver:
    - tls://223.5.5.5
    - tls://223.6.6.6
  nameserver:
    - https://dns.alidns.com/dns-query
    - https://doh.pub/dns-query
  fake-ip-filter:
    - rule-set:connectivity-check
    - rule-set:private_domain
    - rule-set:cn_domain
    - +.miwifi.com
    - +.docker.io
    - +.market.xiaomi.com
    - +.push.apple.com
    - beiyong.dynuddns.net

proxy-groups:
  - {name: 一键连,     <<: *SelectFB, include-all: true, icon: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/image/mihomo.png}
  - {name: 故障转移,   <<: *FallBack, proxies: [香港自动, 台湾自动, 新加坡自动, 日本自动, 韩国自动, 美国自动], icon: https://github.71557.qzz.io/https://github.com/Koolson/Qure/raw/master/IconSet/Color/ULB.png}
  - {name: AI平台,    <<: *SelectUS, include-all: true, icon: https://github.71557.qzz.io/https://github.com/Koolson/Qure/raw/master/IconSet/Color/AI.png}
  - {name: 国际媒体,   <<: *SelectOne, icon: https://github.71557.qzz.io/https://github.com/Koolson/Qure/raw/master/IconSet/Color/DomesticMedia.png}
  - {name: 香港自动,   <<: *UrlTest, filter: *FilterHK, icon: https://github.71557.qzz.io/https://github.com/Koolson/Qure/raw/master/IconSet/Color/Hong_Kong.png}
  - {name: 台湾自动,   <<: *UrlTest, filter: *FilterTW, icon: https://github.71557.qzz.io/https://github.com/Koolson/Qure/raw/master/IconSet/Color/Taiwan.png}
  - {name: 新加坡自动, <<: *UrlTest, filter: *FilterSG, icon: https://github.71557.qzz.io/https://github.com/Koolson/Qure/raw/master/IconSet/Color/Singapore.png}
  - {name: 日本自动,   <<: *UrlTest, filter: *FilterJP, icon: https://github.71557.qzz.io/https://github.com/Koolson/Qure/raw/master/IconSet/Color/Japan.png}
  - {name: 韩国自动,   <<: *UrlTest, filter: *FilterKR, icon: https://github.71557.qzz.io/https://github.com/Koolson/Qure/raw/master/IconSet/Color/Korea.png}
  - {name: 美国自动,   <<: *UrlTest, filter: *FilterUS, icon: https://github.71557.qzz.io/https://github.com/Koolson/Qure/raw/master/IconSet/Color/United_States.png}

rule-providers: 
  Stone:              {type: http, interval: 86400, behavior: classical, format: yaml, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/st/mihomo/rules/Stone.yaml}
  Stone_Proxy:        {type: http, interval: 86400, behavior: classical, format: yaml, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/st/mihomo/rules/Stone_Proxy.yaml}
  download:           {type: http, interval: 86400, behavior: classical, format: yaml, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/download.yaml}
  fix-direct:         {type: http, interval: 86400, behavior: classical, format: yaml, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/fix-direct.yaml}
  XPTV:               {type: http, interval: 86400, behavior: classical, format: yaml, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/XPTV.yaml}
  category-ai-!cn:    {type: http, interval: 86400, behavior: domain, format: mrs, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/category-ai-!cn.mrs}
  geolocation-!cn:    {type: http, interval: 86400, behavior: domain, format: mrs, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/geolocation-!cn.mrs}
  youtube:            {type: http, interval: 86400, behavior: domain, format: mrs, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/youtube.mrs}
  spotify:            {type: http, interval: 86400, behavior: domain, format: mrs, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/spotify.mrs}
  netflix:            {type: http, interval: 86400, behavior: domain, format: mrs, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/netflix.mrs}
  disney:             {type: http, interval: 86400, behavior: domain, format: mrs, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/disney.mrs}
  hbo:                {type: http, interval: 86400, behavior: domain, format: mrs, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/hbo.mrs}
  connectivity-check: {type: http, interval: 86400, behavior: domain, format: mrs, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/connectivity-check.mrs}
  private_domain:     {type: http, interval: 86400, behavior: domain, format: mrs, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/private.mrs}
  cn_domain:          {type: http, interval: 86400, behavior: domain, format: mrs, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/cn.mrs}
  apple-cn:           {type: http, interval: 86400, behavior: domain, format: mrs, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/apple-cn.mrs}
  cn_ip:              {type: http, interval: 86400, behavior: ipcidr, format: mrs, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/cn_ip.mrs}
  private_ip:         {type: http, interval: 86400, behavior: ipcidr, format: mrs, url: https://github.71557.qzz.io/https://github.com/stone6689/YYDS/raw/main/mihomo/rules/private_ip.mrs}

rules: 
  - DST-PORT,123,DIRECT
  - DOMAIN-SUFFIX,imee.me,DIRECT
  - RULE-SET,Stone,DIRECT
  - RULE-SET,Stone_Proxy,国际媒体
  - RULE-SET,category-ai-!cn,AI平台
  - RULE-SET,youtube,国际媒体
  - RULE-SET,spotify,国际媒体
  - RULE-SET,netflix,国际媒体
  - RULE-SET,disney,国际媒体
  - RULE-SET,hbo,国际媒体
  - RULE-SET,download,DIRECT
  - RULE-SET,cn_domain,DIRECT
  - RULE-SET,apple-cn,DIRECT
  - RULE-SET,geolocation-!cn,一键连
  # IP规则
  - RULE-SET,private_ip,DIRECT,no-resolve
  - RULE-SET,cn_ip,DIRECT,no-resolve
  # Fix Direct
  - RULE-SET,fix-direct,DIRECT
  - RULE-SET,XPTV,DIRECT
  - MATCH,一键连
