vernesong / OpenClash

A Clash Client For OpenWrt
MIT License
16.92k stars 3.11k forks source link

[Bug] 持续报错dual stack dial failed #2977

Closed youngxlover closed 1 year ago

youngxlover commented 1 year ago

Verify Steps

OpenClash Version

v0.45.84-beta

Bug on Environment

Official OpenWrt

Bug on Platform

Linux-amd64(x86-64)

To Reproduce

始终存在

Describe the Bug

持续报错dual stack dial failed

OpenClash Log

OpenClash 调试日志

生成时间: 2023-02-02 10:53:01 插件版本: v0.45.84-beta 隐私提示: 上传此日志前请注意检查、屏蔽公网IP、节点、密码等相关敏感信息



#===================== 系统信息 =====================#

主机型号: Default string Default string
固件版本: OpenWrt 22.03.2 10.25.2022
LuCI版本: 
内核版本: 5.15.74
处理器架构: x86_64

#此项有值时,如不使用IPv6,建议到网络-接口-lan的设置中禁用IPV6的DHCP
IPV6-DHCP: 

#此项结果应仅有配置文件的DNS监听地址
Dnsmasq转发设置: 127.0.0.1#7874

#===================== 依赖检查 =====================#

dnsmasq-full: 已安装
coreutils: 已安装
coreutils-nohup: 已安装
bash: 已安装
curl: 已安装
ca-certificates: 已安装
ipset: 已安装
ip-full: 已安装
libcap: 已安装
libcap-bin: 已安装
ruby: 已安装
ruby-yaml: 已安装
ruby-psych: 已安装
ruby-pstore: 已安装
kmod-tun(TUN模式): 已安装
luci-compat(Luci >= 19.07): 已安装
kmod-inet-diag(PROCESS-NAME): 未安装
unzip: 已安装
iptables-mod-tproxy: 已安装
kmod-ipt-tproxy: 已安装
iptables-mod-extra: 已安装
kmod-ipt-extra: 已安装
kmod-ipt-nat: 已安装

#===================== 内核检查 =====================#

运行状态: 运行中
进程pid: 887
运行权限: 887: cap_dac_override,cap_net_bind_service,cap_net_admin,cap_net_raw,cap_sys_ptrace,cap_sys_resource=eip
运行用户: nobody
已选择的架构: linux-amd64

#下方无法显示内核版本号时请确认您的内核版本是否正确或者有无权限
Tun内核版本: 2023.01.29-1-gcc99785
Tun内核文件: 存在
Tun内核运行权限: 正常

Dev内核版本: v1.13.0-1-g81b1e9f
Dev内核文件: 存在
Dev内核运行权限: 正常

Meta内核版本: alpha-g61b3b4f7
Meta内核文件: 存在
Meta内核运行权限: 正常

#===================== 插件设置 =====================#

当前配置文件: /etc/openclash/config/config.yaml
启动配置文件: /etc/openclash/config.yaml
运行模式: redir-host
默认代理模式: rule
UDP流量转发(tproxy): 启用
DNS劫持: 启用
自定义DNS: 启用
IPV6代理: 停用
IPV6-DNS解析: 停用
禁用Dnsmasq缓存: 启用
自定义规则: 启用
仅允许内网: 停用
仅代理命中规则流量: 停用
仅允许常用端口流量: 停用
绕过中国大陆IP: 停用
DNS远程解析: 停用
路由本机代理: 启用

#启动异常时建议关闭此项后重试
混合节点: 停用
保留配置: 停用

#启动异常时建议关闭此项后重试
第三方规则: 启用

#===================== 自定义规则 一 =====================#
script:
##  shortcuts:
##    Notice: The core timezone is UTC
##    CST 20:00-24:00 = time.now().hour > 12 and time.now().hour < 16
##    内核时区为UTC,故以下time.now()函数的取值需要根据本地时区进行转换
##    北京时间(CST) 20:00-24:00 = time.now().hour > 12 and time.now().hour < 16
##    quic: network == 'udp' and dst_port == 443 and (geoip(resolve_ip(host)) != 'CN' or geoip(dst_ip) != 'CN')
##    time-limit: in_cidr(src_ip,'192.168.1.2/32') and time.now().hour < 20 or time.now().hour > 21
##    time-limit: src_ip == '192.168.1.2' and time.now().hour < 20 or time.now().hour > 21

##  code: |
##    def main(ctx, metadata):
##        directkeywordlist = ["baidu"]
##        for directkeyword in directkeywordlist:
##          if directkeyword in metadata["host"]:
##            ctx.log('[Script] matched keyword %s use direct' % directkeyword)
##            return "DIRECT"

rules:
##- SCRIPT,quic,REJECT #shortcuts rule
##- SCRIPT,time-limit,REJECT #shortcuts rule
##- PROCESS-NAME,curl,DIRECT #匹配路由自身进程(curl直连)
##- DOMAIN-SUFFIX,google.com,Proxy #匹配域名后缀(交由Proxy代理服务器组)
##- DOMAIN-KEYWORD,google,Proxy #匹配域名关键字(交由Proxy代理服务器组)
##- DOMAIN,google.com,Proxy #匹配域名(交由Proxy代理服务器组)
##- DOMAIN-SUFFIX,ad.com,REJECT #匹配域名后缀(拒绝)
##- IP-CIDR,127.0.0.0/8,DIRECT #匹配数据目标IP(直连)
##- SRC-IP-CIDR,192.168.1.201/32,DIRECT #匹配数据发起IP(直连)
##- DST-PORT,80,DIRECT #匹配数据目标端口(直连)
##- SRC-PORT,7777,DIRECT #匹配数据源端口(直连)

##排序在上的规则优先生效,如添加(去除规则前的#号):
##IP段:192.168.1.2-192.168.1.200 直连
##- SRC-IP-CIDR,192.168.1.2/31,DIRECT
##- SRC-IP-CIDR,192.168.1.4/30,DIRECT
##- SRC-IP-CIDR,192.168.1.8/29,DIRECT
##- SRC-IP-CIDR,192.168.1.16/28,DIRECT
##- SRC-IP-CIDR,192.168.1.32/27,DIRECT
##- SRC-IP-CIDR,192.168.1.64/26,DIRECT
##- SRC-IP-CIDR,192.168.1.128/26,DIRECT
##- SRC-IP-CIDR,192.168.1.192/29,DIRECT
##- SRC-IP-CIDR,192.168.1.200/32,DIRECT

##IP段:192.168.1.202-192.168.1.255 直连
##- SRC-IP-CIDR,192.168.1.202/31,DIRECT
##- SRC-IP-CIDR,192.168.1.204/30,DIRECT
##- SRC-IP-CIDR,192.168.1.208/28,DIRECT
##- SRC-IP-CIDR,192.168.1.224/27,DIRECT

##此时IP为192.168.1.1和192.168.1.201的客户端流量走代理(策略),其余客户端不走代理
##因为Fake-IP模式下,IP地址为192.168.1.1的路由器自身流量可走代理(策略),所以需要排除

##仅设置路由器自身直连:
##- SRC-IP-CIDR,192.168.1.1/32,DIRECT
##- SRC-IP-CIDR,198.18.0.1/32,DIRECT

##DDNS
##- DOMAIN-SUFFIX,checkip.dyndns.org,DIRECT
##- DOMAIN-SUFFIX,checkipv6.dyndns.org,DIRECT
##- DOMAIN-SUFFIX,checkip.synology.com,DIRECT
##- DOMAIN-SUFFIX,ifconfig.co,DIRECT
##- DOMAIN-SUFFIX,api.myip.com,DIRECT
##- DOMAIN-SUFFIX,ip-api.com,DIRECT
##- DOMAIN-SUFFIX,ipapi.co,DIRECT
##- DOMAIN-SUFFIX,ip6.seeip.org,DIRECT
##- DOMAIN-SUFFIX,members.3322.org,DIRECT

##在线IP段转CIDR地址:http://ip2cidr.com
#===================== 自定义规则 二 =====================#
script:
##  shortcuts:
##    common_port: dst_port not in [21, 22, 23, 53, 80, 123, 143, 194, 443, 465, 587, 853, 993, 995, 998, 2052, 2053, 2082, 2083, 2086, 2095, 2096, 5222, 5228, 5229, 5230, 8080, 8443, 8880, 8888, 8889]

##  code: |
##    def main(ctx, metadata):
##        directkeywordlist = ["baidu"]
##        for directkeyword in directkeywordlist:
##          if directkeyword in metadata["host"]:
##            ctx.log('[Script] matched keyword %s use direct' % directkeyword)
##            return "DIRECT"

rules:
##- SCRIPT,common_port,DIRECT #shortcuts rule
- DOMAIN,,X
- DOMAIN,,DIRECT
##- DOMAIN-SUFFIX,google.com,Proxy #匹配域名后缀(交由Proxy代理服务器组)
##- DOMAIN-KEYWORD,google,Proxy #匹配域名关键字(交由Proxy代理服务器组)
##- DOMAIN,google.com,Proxy #匹配域名(交由Proxy代理服务器组)
##- DOMAIN-SUFFIX,ad.com,REJECT #匹配域名后缀(拒绝)
##- IP-CIDR,127.0.0.0/8,DIRECT #匹配数据目标IP(直连)
##- SRC-IP-CIDR,192.168.1.201/32,DIRECT #匹配数据发起IP(直连)
##- DST-PORT,80,DIRECT #匹配数据目标端口(直连)
##- SRC-PORT,7777,DIRECT #匹配数据源端口(直连)

#===================== 配置文件 =====================#

redir-port: 7892
tproxy-port: 7895
port: 7890
socks-port: 7891
mixed-port: 7893
mode: rule
log-level: silent
allow-lan: true
external-controller: 0.0.0.0:
bind-address: "*"
external-ui: "/usr/share/openclash/ui"
ipv6: false
interface-name: pppoe-wan
geodata-mode: false
geodata-loader: memconservative
tcp-concurrent: false
find-process-mode: 'off'
dns:
  enable: true
  ipv6: false
  enhanced-mode: redir-host
  listen: 0.0.0.0:7874
  nameserver:
  - 127.0.0.1:5335
  fallback:
  - 127.0.0.1:5335
sniffer:
  enable: true
  ForceDnsMapping: true
  ParsePureIp: true
  force-domain:
  - "+.netflix.com"
  - "+.nflxvideo.net"
  - "+.amazonaws.com"
  - "+.media.dssott.com"
  skip-domain:
  - "+.apple.com"
  - Mijia Cloud
  - "+.jd.com"
  sniff:
    TLS:
    HTTP:
      ports:
      - 80
      - 8080-8880
      override-destination: true
profile:
  store-selected: true
  store-fake-ip: true
authentication:

rule-providers:
  Reject:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Reject.yaml
    path: "./rule_provider/Reject"
    interval: 86400
  Special:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Special.yaml
    path: "./rule_provider/Special"
    interval: 86400
  Netflix:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Netflix.yaml
    path: "./rule_provider/Netflix"
    interval: 86400
  Spotify:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Spotify.yaml
    path: "./rule_provider/Spotify"
    interval: 86400
  YouTube:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/YouTube.yaml
    path: "./rule_provider/YouTube"
    interval: 86400
  Bilibili:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Bilibili.yaml
    path: "./rule_provider/Bilibili"
    interval: 86400
  IQ:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/IQ.yaml
    path: "./rule_provider/IQI"
    interval: 86400
  IQIYI:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/IQIYI.yaml
    path: "./rule_provider/IQYI"
    interval: 86400
  Letv:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Letv.yaml
    path: "./rule_provider/Letv"
    interval: 86400
  Netease Music:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Netease%20Music.yaml
    path: "./rule_provider/Netease_Music"
    interval: 86400
  Tencent Video:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Tencent%20Video.yaml
    path: "./rule_provider/Tencent_Video"
    interval: 86400
  Youku:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Youku.yaml
    path: "./rule_provider/Youku"
    interval: 86400
  WeTV:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/WeTV.yaml
    path: "./rule_provider/WeTV"
    interval: 86400
  ABC:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/ABC.yaml
    path: "./rule_provider/ABC"
    interval: 86400
  Abema TV:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Abema%20TV.yaml
    path: "./rule_provider/Abema_TV"
    interval: 86400
  Amazon:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Amazon.yaml
    path: "./rule_provider/Amazon"
    interval: 86400
  Apple Music:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Apple%20Music.yaml
    path: "./rule_provider/Apple_Music"
    interval: 86400
  Apple News:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Apple%20News.yaml
    path: "./rule_provider/Apple_News"
    interval: 86400
  Apple TV:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Apple%20TV.yaml
    path: "./rule_provider/Apple_TV"
    interval: 86400
  Bahamut:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Bahamut.yaml
    path: "./rule_provider/Bahamut"
    interval: 86400
  BBC iPlayer:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/BBC%20iPlayer.yaml
    path: "./rule_provider/BBC_iPlayer"
    interval: 86400
  DAZN:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/DAZN.yaml
    path: "./rule_provider/DAZN"
    interval: 86400
  Discovery Plus:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Discovery%20Plus.yaml
    path: "./rule_provider/Discovery_Plus"
    interval: 86400
  Disney Plus:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Disney%20Plus.yaml
    path: "./rule_provider/Disney_Plus"
    interval: 86400
  encoreTVB:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/encoreTVB.yaml
    path: "./rule_provider/encoreTVB"
    interval: 86400
  F1 TV:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/F1%20TV.yaml
    path: "./rule_provider/F1_TV"
    interval: 86400
  Fox Now:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Fox%20Now.yaml
    path: "./rule_provider/Fox_Now"
    interval: 86400
  Fox+:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Fox%2B.yaml
    path: "./rule_provider/Fox+"
    interval: 86400
  HBO Go:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/HBO%20Go.yaml
    path: "./rule_provider/HBO_Go"
    interval: 86400
  HBO Max:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/HBO%20Max.yaml
    path: "./rule_provider/HBO_Max"
    interval: 86400
  Hulu Japan:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Hulu%20Japan.yaml
    path: "./rule_provider/Hulu_Japan"
    interval: 86400
  Hulu:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Hulu.yaml
    path: "./rule_provider/Hulu"
    interval: 86400
  Japonx:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Japonx.yaml
    path: "./rule_provider/Japonx"
    interval: 86400
  JOOX:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/JOOX.yaml
    path: "./rule_provider/JOOX"
    interval: 86400
  KKBOX:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/KKBOX.yaml
    path: "./rule_provider/KKBOX"
    interval: 86400
  KKTV:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/KKTV.yaml
    path: "./rule_provider/KKTV"
    interval: 86400
  Line TV:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Line%20TV.yaml
    path: "./rule_provider/Line_TV"
    interval: 86400
  myTV SUPER:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/myTV%20SUPER.yaml
    path: "./rule_provider/myTV_SUPER"
    interval: 86400
  Niconico:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Niconico.yaml
    path: "./rule_provider/Niconico"
    interval: 86400
  Pandora:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Pandora.yaml
    path: "./rule_provider/Pandora"
    interval: 86400
  PBS:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/PBS.yaml
    path: "./rule_provider/PBS"
    interval: 86400
  Pornhub:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Pornhub.yaml
    path: "./rule_provider/Pornhub"
    interval: 86400
  Soundcloud:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Soundcloud.yaml
    path: "./rule_provider/Soundcloud"
    interval: 86400
  ViuTV:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/ViuTV.yaml
    path: "./rule_provider/ViuTV"
    interval: 86400
  Telegram:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Telegram.yaml
    path: "./rule_provider/Telegram"
    interval: 86400
  Crypto:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Crypto.yaml
    path: "./rule_provider/Crypto"
    interval: 86400
  Discord:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Discord.yaml
    path: "./rule_provider/Discord"
    interval: 86400
  Steam:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Steam.yaml
    path: "./rule_provider/Steam"
    interval: 86400
  Speedtest:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Speedtest.yaml
    path: "./rule_provider/Speedtest"
    interval: 86400
  PayPal:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/PayPal.yaml
    path: "./rule_provider/PayPal"
    interval: 86400
  Microsoft:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Microsoft.yaml
    path: "./rule_provider/Microsoft"
    interval: 86400
  PROXY:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Proxy.yaml
    path: "./rule_provider/Proxy"
    interval: 86400
  Domestic:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Domestic.yaml
    path: "./rule_provider/Domestic"
    interval: 86400
  Apple:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Apple.yaml
    path: "./rule_provider/Apple"
    interval: 86400
  Google FCM:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Google%20FCM.yaml
    path: "./rule_provider/Google FCM"
    interval: 86400
  Scholar:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Scholar.yaml
    path: "./rule_provider/Scholar"
    interval: 86400
  Domestic IPs:
    type: http
    behavior: ipcidr
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Domestic%20IPs.yaml
    path: "./rule_provider/Domestic_IPs"
    interval: 86400
  LAN:
    type: http
    behavior: classical
    url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/LAN.yaml
    path: "./rule_provider/LAN"
    interval: 86400
script:
  code: |
    def main(ctx, metadata):
        ruleset_action = {"Reject": "AdBlock",
            "Special": "DIRECT",
            "Netflix": "Netflix",
            "Spotify": "Spotify",
            "YouTube": "Youtube",
            "Disney Plus": "Disney",
            "Bilibili": "Bilibili",
            "IQ": "Asian TV",
            "IQIYI": "Asian TV",
            "Letv": "Asian TV",
            "Netease Music": "Asian TV",
            "Tencent Video": "Asian TV",
            "Youku": "Asian TV",
            "WeTV": "Asian TV",
            "ABC": "Global TV",
            "Abema TV": "Global TV",
            "Amazon": "Global TV",
            "Apple Music": "Global TV",
            "Apple News": "Global TV",
            "Apple TV": "Global TV",
            "Bahamut": "Bahamut",
            "BBC iPlayer": "Global TV",
            "DAZN": "DAZN",
            "Discovery Plus": "Discovery Plus",
            "encoreTVB": "Global TV",
            "F1 TV": "Global TV",
            "Fox Now": "Global TV",
            "Fox+": "Global TV",
            "HBO Go": "HBO Go",
            "HBO Max": "HBO Max",
            "Hulu Japan": "Global TV",
            "Hulu": "Global TV",
            "Japonx": "Global TV",
            "JOOX": "Global TV",
            "KKBOX": "Global TV",
            "KKTV": "Global TV",
            "Line TV": "Global TV",
            "myTV SUPER": "Global TV",
            "Niconico": "Global TV",
            "Pandora": "Global TV",
            "PBS": "Global TV",
            "Pornhub": "Pornhub",
            "Soundcloud": "Global TV",
            "ViuTV": "Global TV",
            "Telegram": "Telegram",
            "Crypto": "Crypto",
            "Discord": "Discord",
            "Steam": "Steam",
            "Speedtest": "Speedtest",
            "PayPal": "PayPal",
            "Microsoft": "Microsoft",
            "Apple": "Apple",
            "Google FCM": "Google FCM",
            "Scholar": "Scholar",
            "PROXY": "Proxy",
            "Domestic": "Domestic",
            "Domestic IPs": "Domestic",
            "LAN": "DIRECT"
          }

        port = int(metadata["dst_port"])

        if metadata["network"] == "UDP" and port == 443:
            ctx.log('[Script] matched QUIC traffic use reject')
            return "REJECT"

        port_list = [21, 22, 23, 53, 80, 123, 143, 194, 443, 465, 587, 853, 993, 995, 998, 2052, 2053, 2082, 2083, 2086, 2095, 2096, 3389, 5222, 5228, 5229, 5230, 8080, 8443, 8880, 8888, 8889]
        if port not in port_list:
            ctx.log('[Script] not common port use direct')
            return "DIRECT"

        if metadata["dst_ip"] == "":
            metadata["dst_ip"] = ctx.resolve_ip(metadata["host"])

        for ruleset in ruleset_action:
            if ctx.rule_providers[ruleset].match(metadata):
                return ruleset_action[ruleset]

        if metadata["dst_ip"] != "":
            code = ctx.geoip(metadata["dst_ip"])
            if code == "CN":
                ctx.log('[Script] Geoip CN')
                return "Domestic"

        ctx.log('[Script] FINAL')
        return "Others"

#===================== 测试本机网络下载 =====================#

#===================== 最近运行日志 =====================#

2023-02-02 10:47:52 【TUN】Core Downloading, Please Try to Download and Upload Manually If Fails
2023-02-02 10:47:53 【TUN】Core Download Successful, Start Update...
2023-02-02 10:47:53 【TUN】Core Update Successful!
2023-02-02 10:48:01 【Dev】Core Downloading, Please Try to Download and Upload Manually If Fails
2023-02-02 10:48:02 【Dev】Core Download Successful, Start Update...
2023-02-02 10:48:02 【Dev】Core Update Successful!
time="2023-02-02T10:48:25+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43002 --> 183.57.48.48:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:48:32+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43008 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
2023-02-02 10:48:36 Watchdog: Setting Firewall For Enabling Redirect...
time="2023-02-02T10:48:39+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43010 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:48:46+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43014 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:48:53+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43016 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:49:00+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43018 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:49:07+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43020 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:49:14+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43024 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:49:21+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43032 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:49:28+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43034 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:49:35+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43038 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:49:42+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43042 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:49:49+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43044 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:49:56+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43052 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:50:04+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43062 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:50:11+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43064 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:50:18+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43072 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:50:25+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43074 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:50:32+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43080 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:50:39+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43088 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:50:46+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43096 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:50:53+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43100 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:51:00+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43104 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:51:07+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43106 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:51:14+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43110 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:51:21+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43112 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:51:28+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43120 --> p.conn.t002.ottcn.com:7512 error: dial tcp4 183.57.48.48:7512: i/o timeout"
time="2023-02-02T10:51:35+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43128 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:51:42+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43132 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:51:49+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43134 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:51:56+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43136 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:52:03+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43138 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:52:10+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43140 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:52:17+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43144 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:52:25+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43146 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:52:32+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43148 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:52:39+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43150 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:52:46+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43152 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:52:53+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43154 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:53:00+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43158 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:53:07+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43160 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:53:14+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43162 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"
time="2023-02-02T10:53:21+08:00" level=warning msg="[TCP] dial Domestic (match RuleSet/Domestic IPs) 192.168.6.109:43168 --> p.conn.t002.ottcn.com:7512 error: dual stack dial failed:context deadline exceeded"

#===================== 活动连接信息 =====================#

### OpenClash Config

_No response_

### Expected Behavior

修复报错

### Screenshots

_No response_
helmiau commented 1 year ago

same like mine while routing Genshin Impact ports to DIRECT

MaoSuSu commented 1 year ago

前段时间也遇到过这个了,还以为是节点的问题

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days