Chocolate4U / Iran-v2ray-rules

Enhanced v2ray/xray and v2ray/xray-clients routing rules with built-in Iranian domains and a focus on security and adblocking.
GNU General Public License v3.0
292 stars 21 forks source link

`geoip` file not working! #8

Closed hawshemi closed 11 months ago

hawshemi commented 11 months ago

I tested all the geoip files but non of them are working.

For example, I put this:

            {
                "type": "field",
                "ip": [
                    "geoip:openai"
                ],
                "outboundTag": "block"
            },

This rule should block openai, but after applying and restarting, nothing will happen and the website opens. in the logs:

Oct 20 12:14:59 XXX xray[9064]: 2023/10/20 12:14:59 XXX:29096 accepted tcp:chat.openai.com:443 [direct]

it says direct and not blocked! I tested with domain:openai.com in the rule and it will work (but only for the domain obviously)

This happens for all geoip rules from this repo.

Chocolate4U commented 11 months ago

It is because this domain is behind Cloudflare CDN. when client resolves this address, it returnes Cloudflare IP and not actual Openai's IP and routing happens based on Cloudflare IP. You can block cloudflare's IPs and check the results again.

Generally, routing based on IP address is not very accurate because of this.