Loyalsoldier / v2ray-rules-dat

🦄 🎃 👻 V2Ray 路由规则文件加强版,可代替 V2Ray 官方 geoip.dat 和 geosite.dat,适用于 V2Ray、Xray-core、mihomo(Clash-Meta)、hysteria、Trojan-Go 和 leaf。Enhanced edition of V2Ray rules dat files, applicable to V2Ray, Xray-core, mihomo(Clash-Meta), hysteria, Trojan-Go and leaf.
GNU General Public License v3.0
14.54k stars 1.68k forks source link

域名规则设置 无法通过地区检测 无法打开链接 githubusercontent.com #322

Closed InnocenseYu closed 10 months ago

InnocenseYu commented 10 months ago

问题:

  1. 配置文件走域名规则,域名已设置代理,但是网站无法通过地区检测(全局代理测试,节点支持解锁网站)
  2. 可访问 github.com,但是无法打开链接 githubusercontent.com,也不知从怎么解决,望各位大佬指点

client

{
    "log": {
        "loglevel": "warning"
    },

    "dns": {
        "hosts": {
            "domain:googleapis.cn": "googleapis.com",
            "dns.google": "8.8.8.8",
            "dns.pub": "119.29.29.29",
            "dns.alidns.com": "223.5.5.5",
            "geosite:category-ads-all": "127.0.0.1"
        },
        "servers": [
            {
                "address": "https://1.1.1.1/dns-query",
                "domains": [
                    "geosite:geolocation-!cn",
                    "geosite:google@cn"
                ],
                "expectIPs": [
                    "geoip:!cn"
                ],
                "skipFallback": false
            },
            {
                "address": "8.8.8.8",
                "port": 53,
                "skipFallback": false
            },
            {
                "address": "223.5.5.5",
                "port": 53,
                "domains": [
                    "geosite:cn",
                    "geosite:icloud",
                    "geosite:category-games@cn",
                    "ntp.org"
                ],
                "expectIPs": [
                    "geoip:cn"
                ],
                "skipFallback": true
            },
            {
                "address": "114.114.114.114",
                "port": 53,
                "domains": [
                    "geosite:cn",
                    "ntp.org"
                ],
                "skipFallback": true
            },
            {
                "address": "localhost",
                "skipFallback": true
            }
        ]
    },

    "inbounds": [
        {
            "tag": "all-in",
            "port": 20000,
            "protocol": "dokodemo-door",
            "settings": {
                "network": "tcp,udp",
                "followRedirect": true
            },
            "sniffing": {
                "enabled": true,
                "destOverride": [
                    "http", 
                    "tls", 
                    "quic"
                ]
            },
            "streamSettings": {
                "sockopt": {
                    "tproxy": "tproxy"
                }
            }
        }
    ],

    "routing": {
        "domainMatcher": "hybrid",
        "domainStrategy": "IPIfNonMatch",
        "rules": [
            {
                "type": "field",
                "protocol": [
                    "bittorrent"
                ],
                "outboundTag": "direct"
            },
            {
                "type": "field",
                "inboundTag": [
                    "all-in"
                ],
                "port": 123,
                "network": "udp",
                "outboundTag": "direct"
            },
            {
                "type": "field",
                "inboundTag": [
                    "all-in"
                ],
                "port": 53,
                "network": "udp",
                "outboundTag": "dns-out"
            },
            {
                "type": "field",
                "domain": "geosite:category-ads-all",
                "outboundTag": "block"
            },
            {
                "type": "field",
                "ip": [
                    "223.5.5.5",
                    "119.29.29.29",
                    "114.114.114.114"
                ],
                "outboundTag": "direct"
            },
            {
                "type": "field",
                "ip": [
                    "1.1.1.1",
                    "1.0.0.1",
                    "8.8.8.8",
                    "8.8.4.4"
                ],
                "outboundTag": "hk-out"
            },
            {
                "type": "field",
                "domain": [
                    "domain:histar.tv",
                    "domain:ulivetv.net",
                    "domain:cloudfront.net",
                    "domain:ceres9350.com",
                    "domain:efhie.com"
                ],
                "outboundTag": "hk-out"
            },
            {
                "type": "field",
                "domain": [
                    "geosite:github"
                ],
                "outboundTag": "hk-out"
            },
            {
                "type": "field",
                "domain": [
                    "full:www.icloud.com",
                    "domain:icloud-content.com"
                ],
                "outboundTag": "hk-out"
            },
            {
                "type": "field",
                "domain": [
                    "geosite:icloud"
                ],
                "outboundTag": "direct"
            },
            {
                "type": "field",
                "domain": [
                    "geosite:apple"
                ],
                "outboundTag": "direct"
            },
            {
                "type": "field",
                "domain": [
                    "domain:googleapis.cn",
                    "dns.google",
                    "geosite:google"
                ],
                "outboundTag": "hk-out"
            },
            {
                "type": "field",
                "domain": [
                    "geosite:geolocation-!cn"
                ],
                "outboundTag": "hk-out"
            },
            {
                "type": "field",
                "domain": [
                    "geosite:tld-cn",
                    "geosite:category-games@cn"
                ],
                "outboundTag": "direct"
            },
            {
                "type": "field",
                "domain": [
                    "geosite:cn",
                    "geosite:private"
                ],
                "outboundTag": "direct"
            },
            {
                "type": "field",
                "ip": [
                    "geoip:cn", 
                    "geoip:private"
                ],
                "outboundTag": "direct"
            },
            {
                "type": "field",
                "network": "tcp,udp",
                "outboundTag": "hk-out"
            }
        ]
    },

    "outbounds": [
        {
            "tag": "hk-out"
        },
        {
            "tag": "dns-out",
            "protocol": "dns",
            "streamSettings": {
                "sockopt": {
                    "mark": 255
                }
            }
        },
        {
            "tag": "direct",
            "protocol": "freedom",
            "settings": {
                "domainStrategy": "UseIPv4"
            },
            "streamSettings": {
                "sockopt": {
                    "mark": 255
                }
            }
        },
        {
            "tag": "block",
            "protocol": "blackhole",
            "settings": {
                "response": {
                    "type": "http"
                }
            }
        }
    ]
}

server

{
    "log": {
        "loglevel": "warning",
        "access": "/var/log/xray/access.log",
        "error": "/var/log/xray/error.log"
    },

    "dns": {
        "servers": [
            "https+local://1.1.1.1/dns-query",
            "localhost"
        ]
    },

    "inbounds": [],

     "routing": {
        "domainStrategy": "IPIfNonMatch",
        "rules": [
            {
                "type": "field",
                "domain": [
                    "geosite:category-ads-all"
                ],
                "outboundTag": "block"
            },
            {
                "type": "field",
                "ip": [
                    "geoip:private"
                ],
                "outboundTag": "block"
            },
            {
                "type": "field",
                "ip": ["geoip:cn"],
                "outboundTag": "block"
            }
        ]
    },

    "outbounds": [

        {
            "tag": "direct",
            "protocol": "freedom"
        },
        {
            "tag": "block",
            "protocol": "blackhole"
        }
    ]

}