From 291770a5f0a6565935437a18b4057d4f04d405bd Mon Sep 17 00:00:00 2001 From: Meow <197331664+Meo597@users.noreply.github.com> Date: Sat, 18 Apr 2026 19:08:21 +0800 Subject: [PATCH] GeoIP: Update inverse geoip syntax examples https://github.com/XTLS/Xray-core/pull/5951#issuecomment-4273468491 --- docs/config/routing.md | 2 +- docs/document/level-1/routing-with-dns.md | 4 ++-- docs/en/config/routing.md | 2 +- docs/en/document/level-1/routing-with-dns.md | 4 ++-- docs/ru/config/routing.md | 2 +- docs/ru/document/level-1/routing-with-dns.md | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/config/routing.md b/docs/config/routing.md index 80391716..e5bd4a01 100644 --- a/docs/config/routing.md +++ b/docs/config/routing.md @@ -108,7 +108,7 @@ - 预定义 IP 列表:此列表预置于每一个 Xray 的安装包中,文件名为 `geoip.dat`。使用方式形如 `"geoip:cn"`,必须以 `geoip:`(小写)开头,后面跟双字符国家代码,支持几乎所有可以上网的国家。 - 特殊值:`"geoip:private"`,包含所有私有地址,如 `127.0.0.1`。 - 从文件中加载 IP:形如 `"ext:file:tag"`,必须以 `ext:`(小写)开头,后面跟文件名和标签,文件存放在 [资源目录](./features/env.md#资源文件路径) 中,文件格式与 `geoip.dat` 相同标签必须在文件中存在。 -- 反选 `!` 功能:`"!10.0.0.0/8"` 表示非 `10.0.0.0/8`,`"!geoip:cn"` 表示非 `geoip:cn` 中的结果。多个反选项之间是 `AND` 关系,而正选项、正选项和所有的反选项之间是 `OR` 关系,例如 `ip: ["geoip:!cn", "!geoip:us", "geoip:telegram"]` 匹配非美国并且非中国的 IP,或者是 telegram 的 IP。 +- 反选 `!` 功能:`"!10.0.0.0/8"` 表示非 `10.0.0.0/8`,`"!geoip:cn"` 表示非 `geoip:cn` 中的结果。多个反选项之间是 `AND` 关系,而正选项、正选项和所有的反选项之间是 `OR` 关系,例如 `ip: ["!geoip:cn", "!geoip:us", "geoip:telegram"]` 匹配非美国并且非中国的 IP,或者是 telegram 的 IP。 > `port`:number | string diff --git a/docs/document/level-1/routing-with-dns.md b/docs/document/level-1/routing-with-dns.md index 9b071f83..00804de7 100644 --- a/docs/document/level-1/routing-with-dns.md +++ b/docs/document/level-1/routing-with-dns.md @@ -99,13 +99,13 @@ socks、http 入站时,请求的就是域名,到了路由后,路由中非 "address": "1.1.1.1", "skipFallback": true, "domains": ["geosite:geolocation-!cn"], - "expectIPs": ["geoip:!cn"] + "expectIPs": ["!geoip:cn"] }, { "address": "8.8.8.8", "skipFallback": true, "domains": ["geosite:geolocation-!cn"], - "expectIPs": ["geoip:!cn"] + "expectIPs": ["!geoip:cn"] }, { "address": "8.8.8.8", diff --git a/docs/en/config/routing.md b/docs/en/config/routing.md index 9a025d78..82aa2a7d 100644 --- a/docs/en/config/routing.md +++ b/docs/en/config/routing.md @@ -108,7 +108,7 @@ An array, where each item represents an IP range. The rule takes effect when an - **Predefined IP list**: This list is pre-installed in every Xray installation package, named `geoip.dat`. Usage is like `"geoip:cn"`. Must start with `geoip:` (lowercase), followed by a two-character country code. Supports almost all countries with internet access. - **Special value**: `"geoip:private"`, includes all private addresses, such as `127.0.0.1`. - **Load IPs from file**: In the form of `"ext:file:tag"`. Must start with `ext:` (lowercase), followed by filename and tag. The file is stored in the [Resource Directory](./features/env.md#resource-file-path). The file format is the same as `geoip.dat`, and the tag must exist in the file. -- **Inverse selection `!`**: `"!10.0.0.0/8"` means anything not in `10.0.0.0/8`, and `"!geoip:cn"` means results not in `geoip:cn`. Multiple inverse options have an `AND` relationship, while positive options, or positive options together with all inverse options, have an `OR` relationship. For example, `ip: ["geoip:!cn", "!geoip:us", "geoip:telegram"]` matches IPs that are not from the US AND not from China, OR are Telegram IPs. +- **Inverse selection `!`**: `"!10.0.0.0/8"` means anything not in `10.0.0.0/8`, and `"!geoip:cn"` means results not in `geoip:cn`. Multiple inverse options have an `AND` relationship, while positive options, or positive options together with all inverse options, have an `OR` relationship. For example, `ip: ["!geoip:cn", "!geoip:us", "geoip:telegram"]` matches IPs that are not from the US AND not from China, OR are Telegram IPs. > `port`: number | string diff --git a/docs/en/document/level-1/routing-with-dns.md b/docs/en/document/level-1/routing-with-dns.md index d1fadf7d..8ff0285a 100644 --- a/docs/en/document/level-1/routing-with-dns.md +++ b/docs/en/document/level-1/routing-with-dns.md @@ -101,13 +101,13 @@ Having trouble? You need to re-read the official guide and try to understand it. "address": "1.1.1.1", "skipFallback": true, "domains": ["geosite:geolocation-!cn"], - "expectIPs": ["geoip:!cn"] + "expectIPs": ["!geoip:cn"] }, { "address": "8.8.8.8", "skipFallback": true, "domains": ["geosite:geolocation-!cn"], - "expectIPs": ["geoip:!cn"] + "expectIPs": ["!geoip:cn"] }, { "address": "8.8.8.8", diff --git a/docs/ru/config/routing.md b/docs/ru/config/routing.md index 2b1ac05a..997761f0 100644 --- a/docs/ru/config/routing.md +++ b/docs/ru/config/routing.md @@ -104,7 +104,7 @@ - Предопределенный список IP-адресов: этот список встроен в каждый установочный пакет Xray, имя файла - `geoip.dat`. Формат использования: `"geoip:код_страны"`, должно начинаться с `geoip:` (в нижнем регистре), за которым следует двухбуквенный код страны, поддерживаются почти все страны с доступом в Интернет. - Специальное значение: `"geoip:private"`, включает в себя все частные адреса, например, `127.0.0.1`. - Загрузка IP-адресов из файла: имеет вид `"ext:файл:тег"`, должно начинаться с `ext:` (в нижнем регистре), за которым следует имя файла и тег, файл хранится в [каталоге ресурсов](./features/env.md#путь-к-файлу-ресурсов), формат файла такой же, как у `geoip.dat`, тег должен существовать в файле. -- Функция инверсии `!`: `"!10.0.0.0/8"` обозначает всё, что не входит в `10.0.0.0/8`, а `"!geoip:cn"` — результаты, не входящие в `geoip:cn`. Несколько условий с отрицанием объединяются логическим **AND**, а положительные условия и совокупность всех отрицательных условий — логическим **OR**. Например, `ip: ["geoip:!cn", "!geoip:us", "geoip:telegram"]` соответствует IP, которые не относятся к США **И** не относятся к Китаю, **ИЛИ** являются IP Telegram. +- Функция инверсии `!`: `"!10.0.0.0/8"` обозначает всё, что не входит в `10.0.0.0/8`, а `"!geoip:cn"` — результаты, не входящие в `geoip:cn`. Несколько условий с отрицанием объединяются логическим **AND**, а положительные условия и совокупность всех отрицательных условий — логическим **OR**. Например, `ip: ["!geoip:cn", "!geoip:us", "geoip:telegram"]` соответствует IP, которые не относятся к США **И** не относятся к Китаю, **ИЛИ** являются IP Telegram. > `port`: number | string diff --git a/docs/ru/document/level-1/routing-with-dns.md b/docs/ru/document/level-1/routing-with-dns.md index 7de98d32..cc986041 100644 --- a/docs/ru/document/level-1/routing-with-dns.md +++ b/docs/ru/document/level-1/routing-with-dns.md @@ -102,13 +102,13 @@ "address": "1.1.1.1", "skipFallback": true, "domains": ["geosite:geolocation-!cn"], - "expectIPs": ["geoip:!cn"] + "expectIPs": ["!geoip:cn"] }, { "address": "8.8.8.8", "skipFallback": true, "domains": ["geosite:geolocation-!cn"], - "expectIPs": ["geoip:!cn"] + "expectIPs": ["!geoip:cn"] }, { "address": "8.8.8.8",